YUKI Hiroshi
null+****@clear*****
Thu Nov 1 19:00:43 JST 2012
YUKI Hiroshi 2012-11-01 19:00:43 +0900 (Thu, 01 Nov 2012) New Revision: 2eb23dfef0184a0c6abb13faf4dfc5867bc6a271 https://github.com/groonga/gcs/commit/2eb23dfef0184a0c6abb13faf4dfc5867bc6a271 Log: Output timestamp for all lines Modified files: lib/logger.js Modified: lib/logger.js (+3 -9) =================================================================== --- lib/logger.js 2012-11-01 18:57:44 +0900 (8f898d1) +++ lib/logger.js 2012-11-01 19:00:43 +0900 (73de8c0) @@ -34,15 +34,9 @@ Logger.prototype = { }, log: function(message) { var timestamp = '[' + this.getTimestamp() + ']'; - message = message.split('\n'); - if (message.length == 1) { - this.stream.write(timestamp + ' ' + message[0] + '\n'); - } else { - this.stream.write(timestamp + '\n'); - message.forEach(function(line) { - this.stream.write(' ' + line + '\n'); - }, this); - } + message.split('\n').forEach(function(line) { + this.stream.write(timestamp + ' ' + line + '\n'); + }, this); } }; -------------- next part -------------- HTML����������������������������... Télécharger