]> git.r.bdr.sh - rbdr/cologne/commitdiff
Better socket support and skipConsole 4 JsConsole
authorBen Beltran <redacted>
Tue, 25 Jun 2013 17:10:17 +0000 (12:10 -0500)
committerBen Beltran <redacted>
Tue, 25 Jun 2013 17:10:17 +0000 (12:10 -0500)
lib/loggers/console.js
lib/loggers/socket.js
package.json

index e8f4d86f4cac8c45c7709b87dba3b81aef50eed8..c8e3036bc8497ca44d8a5abaf592bdbe348b4c22 100644 (file)
         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
+            }
           }
         }
 
index d9ae05577ed4a9815dc8eafaa1a9735b8c562673..739c5b326852f00bc8eebc8bc5cb2c027588ac6b 100644 (file)
     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 () {
index 5da323cc863cca1927866fac39d923e25429dfe6..66c40d6202e2f6b8eece9ae05faf3b3cd6e35733 100644 (file)
@@ -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",