Skip to content

Commit

Permalink
fix(logger): fix logger metadata handling (#55)
Browse files Browse the repository at this point in the history
fix the way we handle metadata check in logger to prevent double LF
  • Loading branch information
mattallty authored May 29, 2017
1 parent ecd145f commit d0b9953
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const CaporalTransport = function (options) {
util.inherits(CaporalTransport, winston.Transport);

CaporalTransport.prototype.log = function (level, msg, meta, callback) {
if (meta !== null && typeof meta !== 'undefined') {
if (meta !== null && typeof meta === 'object' && Object.keys(meta).length) {
msg += "\n" + prettyjson.render(meta);
}
msg += "\n";
Expand Down

0 comments on commit d0b9953

Please sign in to comment.