]> git.r.bdr.sh - rbdr/cologne/blobdiff - lib/loggers/file.js
Merge pull request #1 from sgarza/master
[rbdr/cologne] / lib / loggers / file.js
index 0512ace110910559389916b3a63f870f0341edf3..5ba8a179bd828f63df12d2f458f00ca2868fc274 100644 (file)
@@ -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);
     }
   }
 });