From: Ben Beltran Date: Fri, 9 Jan 2015 16:38:51 +0000 (-0600) Subject: Makes file logger raw if no formatter present X-Git-Tag: v1.1.0~7 X-Git-Url: https://git.r.bdr.sh/rbdr/cologne/commitdiff_plain/de7f6029774eb7cb58e59d0ab7e914a54bce69e3?ds=sidebyside;hp=-c Makes file logger raw if no formatter present --- de7f6029774eb7cb58e59d0ab7e914a54bce69e3 diff --git a/lib/loggers/file.js b/lib/loggers/file.js index 0512ace..5ba8a17 100644 --- a/lib/loggers/file.js +++ b/lib/loggers/file.js @@ -22,11 +22,7 @@ Class(Cobalt.Logger, 'File')({ // We're not formatting objects for now. if (!arguments[i].__skipConsole && !arguments[i].message.__skipConsole) { - if (typeof arguments[i].message === 'object') { - message.push(arguments[i].message); - } else { - message.push(this.format(arguments[i])); - } + message.push(this.format(arguments[i])); if (!severity) { severity = arguments[i]._level } @@ -40,10 +36,13 @@ Class(Cobalt.Logger, 'File')({ format : function (logObject) { if (this.formatter) { + if (typeof logObject.message === 'object') { + return logObject.message; + } return this.formatter.format(logObject, this.formatterOpts); } - return logObject.message; + return Cobalt.stringify(logObject); } } });