From 6df8755d1a2abf621f8ea70c8b8a14e04d41fd11 Mon Sep 17 00:00:00 2001 From: Martii Date: Wed, 24 Feb 2016 05:39:35 -0700 Subject: [PATCH] Tweak some logging messages * Post first 100 chars of body for relase *express-minify* on error... id what's occasionally happening. Hopefully this is enough. * Remove logging from #901... got some data and posted Unit Test data at https://github.com/OpenUserJs/OpenUserJS.org/pull/901/files#r53597717 * Expand single removal message to be more specific Applies to #430 --- app.js | 6 ++---- controllers/scriptStorage.js | 4 ---- libs/remove.js | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/app.js b/app.js index 1551141e6..a4d5516eb 100755 --- a/app.js +++ b/app.js @@ -220,14 +220,12 @@ app.set('views', __dirname + '/views'); // Setup minification // Order is important here as Ace will fail with an invalid content encoding issue var minifyErrorHandler = function (aErr, aStage, aAssetType, aMinifyOptions, aBody, aCallback) { - - // TODO: Lookup script meta with aBody for script identification? - console.warn([ // NOTE: Pushing this to stderr instead of default stdout 'MINIFICATION WARNING (release):', ' filename: ' + aErr.filename, ' message: ' + aErr.message, - ' line: ' + aErr.line + ' col: ' + aErr.col + ' pos: ' + aErr.pos + ' line: ' + aErr.line + ' col: ' + aErr.col + ' pos: ' + aErr.pos, + ' body: ' + body.slice(0, 100) ].join('\n')); diff --git a/controllers/scriptStorage.js b/controllers/scriptStorage.js index fbe0dcaa8..2bde107b7 100644 --- a/controllers/scriptStorage.js +++ b/controllers/scriptStorage.js @@ -737,10 +737,6 @@ exports.webhook = function (aReq, aRes) { payload.commits.forEach(function (aCommit) { aCommit.modified.forEach(function (aFilename) { if (aFilename.substr(-8) === '.user.js') { - console.log([ - 'Webhook filename:', - ' ' + aFilename - ].join('\n')); // TODO: After some data collected, reaffirm and remove this repo[aFilename] = '/' + encodeURI(aFilename); // NOTE: Watchpoint } }); diff --git a/libs/remove.js b/libs/remove.js index 819f39c71..c68e362b0 100644 --- a/libs/remove.js +++ b/libs/remove.js @@ -97,14 +97,14 @@ function remove(aModel, aContent, aUser, aReason, aAutomated, aCallback) { removeModel.save(function (aErr, aRemove) { if (aErr || !aRemove) { - console.error('Failed to save to the Graveyard'); + console.error('Failed to save to the Graveyard', aModel.modelName, aContent._id); aCallback(aErr); return; } aContent.remove(function (aErr) { if (aErr) { - console.error('Failed to remove', aModel.modelName); + console.error('Failed to remove', aModel.modelName, aContent._id); aCallback(aErr); // NOTE: Same as `true` but specific e.g. stop all removal(s) return; }