From 85057e4c3e4d02483b6fbacdce89cb8b8ed6c022 Mon Sep 17 00:00:00 2001 From: Marc Knaup Date: Fri, 7 Feb 2014 11:55:27 +0100 Subject: [PATCH] Replaced util.puts with console.log due to deprecation in Node 0.11 --- lib/nlogger.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nlogger.js b/lib/nlogger.js index 89e767a..585f43d 100644 --- a/lib/nlogger.js +++ b/lib/nlogger.js @@ -92,7 +92,7 @@ try { var file = fs.readFileSync('./nlogger.json', 'binary'), config = JSON.parse(file); } catch(e) { - util.puts(getDate() + ' WARN nlogger - Config file not found. Using default configuration.'); + console.log('%s', getDate() + ' WARN nlogger - Config file not found. Using default configuration.'); config = {}; } @@ -120,13 +120,13 @@ exports.logger = function(module) { if (useColor) { logger[level] = function(msg) { if (methods[level].priority >= priority) { - util.puts('\x1B[' + methods[level].color + 'm' + getDate() + ' ' + levelStr + ' ' + getClass(module) +':' + getLine() + ' - ' + getMessage(arguments) + '\x1B[0m'); + console.log('%s', '\x1B[' + methods[level].color + 'm' + getDate() + ' ' + levelStr + ' ' + getClass(module) +':' + getLine() + ' - ' + getMessage(arguments) + '\x1B[0m'); } }; } else { logger[level] = function(msg) { if (methods[level].priority >= priority) { - util.puts(getDate() + ' ' + levelStr + ' ' + getClass(module) +':' + getLine() + ' - ' + getMessage(arguments)); + console.log('%s', getDate() + ' ' + levelStr + ' ' + getClass(module) +':' + getLine() + ' - ' + getMessage(arguments)); } }; }