Parsing log output when saving to file #306
authorDarren <darren@darrenwhitlen.com>
Thu, 20 Jun 2013 21:05:34 +0000 (22:05 +0100)
committerDarren <darren@darrenwhitlen.com>
Thu, 20 Jun 2013 21:05:55 +0000 (22:05 +0100)
server/kiwi.js

index 6e697f75a7b306c780af3cc6f3bd003abb455568..35c0a499fb1f7667dae6ba9bedf09e679e99d24e 100755 (executable)
@@ -1,5 +1,6 @@
 var fs          = require('fs'),
     _           = require('lodash'),
+    util        = require('util'),
     WebListener = require('./weblistener.js'),
     config      = require('./configuration.js'),
     rehash      = require('./rehash.js'),
@@ -28,7 +29,7 @@ if (process.argv.indexOf('-f') === -1 && global.config && global.config.log) {
             var logfile = fs.openSync(log_file_name, 'a'),
                 out;
 
-            out = Array.prototype.join.apply(arguments, [' ']);
+            out = util.format.apply(util, arguments);
 
             // Make sure we out somthing to log and we have an open file
             if (!out || !logfile) return;