X-Git-Url: https://git.r.bdr.sh/rbdr/cologne/blobdiff_plain/bdedb5e54032363de8afa322fadae0e2cb2132d0..0a83aa95ac41f8c8aed5177c5be93469fd9f6192:/lib/loggers/console.js?ds=inline diff --git a/lib/loggers/console.js b/lib/loggers/console.js index 3dc4b1d..5002502 100644 --- a/lib/loggers/console.js +++ b/lib/loggers/console.js @@ -16,7 +16,7 @@ Cobalt.Logger.JsConsole = Class(Cobalt.Logger, 'JsConsole')({ prototype : { - console : console, + console : null, formatterOpts : {}, init : function (config) { @@ -30,12 +30,19 @@ } }, - log : function (logObject) { - var message; + log : function () { + var i, messageArray = [], message, severity; - message = this.format(logObject); + for (i = 0; i < arguments.length; i++) { + messageArray.push(this.format(arguments[i])); + if (!severity) { + severity = arguments[i]._level + } + } + + message = messageArray.join(' '); - switch (logObject._level){ + switch (severity){ case 0: case 1: case 2: @@ -68,6 +75,10 @@ } }); + if (Cobalt.Logger.JsConsole.__objectSpy) { + Cobalt.Logger.JsConsole.__objectSpy.destroy(); + } + if (typeof require === 'function') { global.JsConsole = Cobalt.Logger.JsConsole; } else {