Skip to content

Commit

Permalink
Fix rendering of stack traces
Browse files Browse the repository at this point in the history
When humanReadableUnhandledException is true, render stack traces without trailing commas. This makes possible for an IDE to have clickable stack traces
  • Loading branch information
eeroan authored and indexzero committed Apr 7, 2015
1 parent dadfe8f commit b83de62
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions lib/winston/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,7 @@ exports.log = function (options) {
delete meta.stack;
delete meta.trace;
output += ' ' + exports.serialize(meta);
output += '\n' + stack.map(function (s) {
return s + '\n';
});
output += '\n' + stack.join('\n');
} else {
output += ' ' + exports.serialize(meta);
}
Expand Down
1 change: 0 additions & 1 deletion test/humanReadableUnhandledException-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ vows.describe('winston/transport/humanReadableUnhandledException').addBatch({
var msg = transport.writeOutput[0];
assert.notEqual(-1, msg.indexOf('stack: date=dummy date, process=dummy, os=dummy\n'));
assert.notEqual(-1, msg.indexOf(meta.stack[0] + '\n'));
assert.notEqual(-1, msg.indexOf(',' + meta.stack[1]));
});
}
}
Expand Down

0 comments on commit b83de62

Please sign in to comment.