X-Git-Url: https://git.r.bdr.sh/rbdr/cologne/blobdiff_plain/b03b58455bb63138526e363f3c5570911eb78bf8..941d09019e402ac565101fba6d824bd48504c90b:/lib/loggers/console.js?ds=inline diff --git a/lib/loggers/console.js b/lib/loggers/console.js index 465a436..c8e3036 100644 --- a/lib/loggers/console.js +++ b/lib/loggers/console.js @@ -30,39 +30,45 @@ } if (!logger.console) { - logger.console = global.console; + logger.console = console; } }, log : function () { - var i, messageArray = [], message, severity; + var i, message = [], severity; for (i = 0; i < arguments.length; i++) { - messageArray.push(this.format(arguments[i])); - if (!severity) { - severity = arguments[i]._level + // 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])); + } + if (!severity) { + severity = arguments[i]._level + } } } - message = messageArray.join(' '); - switch (severity){ case 0: case 1: case 2: case 3: - this.console.error(message); + this.console.error.apply(this.console, message); break; case 4: - this.console.warn(message); + this.console.warn.apply(this.console, message); break; case 5: case 6: - this.console.info(message); + this.console.info.apply(this.console, message); break; case 7: default: - this.console.log(message); + this.console.log.apply(this.console, message); break; } }, @@ -74,7 +80,7 @@ return this.formatter.format(logObject, this.formatterOpts); } - return logObject; + return logObject.message; } } });