From: Ben Beltran Date: Tue, 25 Jun 2013 17:10:17 +0000 (-0500) Subject: Better socket support and skipConsole 4 JsConsole X-Git-Tag: v1.1.0~26 X-Git-Url: https://git.r.bdr.sh/rbdr/cologne/commitdiff_plain/c315b8c3c28373aeb28889cf4b09041d98cd5320 Better socket support and skipConsole 4 JsConsole --- diff --git a/lib/loggers/console.js b/lib/loggers/console.js index e8f4d86..c8e3036 100644 --- a/lib/loggers/console.js +++ b/lib/loggers/console.js @@ -40,13 +40,15 @@ for (i = 0; i < arguments.length; i++) { // We're not formatting objects for now. - if (typeof arguments[i].message === 'object') { - message.push(arguments[i].message); - } else { - message.push(this.format(arguments[i])); - } - if (!severity) { - severity = arguments[i]._level + 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 + } } } diff --git a/lib/loggers/socket.js b/lib/loggers/socket.js index d9ae055..739c5b3 100644 --- a/lib/loggers/socket.js +++ b/lib/loggers/socket.js @@ -18,8 +18,17 @@ prototype : { serverUrl : '/', - init : function () { - this._socket = io.connect(this.serverUrl); + init : function (config) { + var logger = this; + logger.socketIo = io; + + if (config) { + for (property in config) { + logger[property] = config[property]; + } + } + + logger._socket = logger.socketIo.connect(logger.serverUrl); }, log : function () { diff --git a/package.json b/package.json index 5da323c..66c40d6 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "url" : "http://github.com/ktlacaelel" } ], - "version" : "0.1.7", + "version" : "0.1.8", "dependencies" : { "neon" : "1.0.x", "socket.io" : "0.9.x",