Skip to content

Commit

Permalink
Release 1.0.5 Winston Support for object logging
Browse files Browse the repository at this point in the history
  • Loading branch information
respectus committed Aug 16, 2016
1 parent 05b827c commit f27f958
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/winston.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ WinstonTransport.prototype.log = function(level, msg, meta, callback) {
if (meta instanceof Error) { meta = { error: meta.stack || meta.toString() }; }
var opts = meta;
opts.level = level;
if (!msg && typeof meta === 'object') {
msg = util.inspect(meta);
}
this.logger.log(msg, opts);
if (callback) { callback(null, true); }
};

0 comments on commit f27f958

Please sign in to comment.