Skip to content

Commit

Permalink
Tweak some logging messages
Browse files Browse the repository at this point in the history
* Post first 100 chars of body for relase *express-minify* on error... id what's occasionally happening. Hopefully this is enough.
* Remove logging from OpenUserJS#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 OpenUserJS#430
  • Loading branch information
Martii committed Feb 24, 2016
1 parent 0633615 commit 6df8755
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
6 changes: 2 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));

Expand Down
4 changes: 0 additions & 4 deletions controllers/scriptStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
});
Expand Down
4 changes: 2 additions & 2 deletions libs/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6df8755

Please sign in to comment.