From 106b670c5f4820f66a4ff3f7f2a6c236b624f5be Mon Sep 17 00:00:00 2001 From: John Frizelle Date: Fri, 24 May 2013 00:42:40 +0100 Subject: [PATCH] Allow debug messages to be sent to stdout --- lib/winston/transports/console.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/winston/transports/console.js b/lib/winston/transports/console.js index ee5bcf9c5..da7f24523 100644 --- a/lib/winston/transports/console.js +++ b/lib/winston/transports/console.js @@ -28,6 +28,7 @@ var Console = exports.Console = function (options) { this.timestamp = typeof options.timestamp !== 'undefined' ? options.timestamp : false; this.label = options.label || null; this.logstash = options.logstash || false; + this.debugStdout = options.debugStdout || false; if (this.json) { this.stringify = options.stringify || function (obj) { @@ -76,7 +77,7 @@ Console.prototype.log = function (level, msg, meta, callback) { logstash: this.logstash }); - if (level === 'error' || level === 'debug') { + if (level === 'error' || (level === 'debug' && !this.debugStdout) ) { process.stderr.write(output + '\n'); } else { process.stdout.write(output + '\n');