Skip to content

Commit

Permalink
Allow debug messages to be sent to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
John Frizelle authored and indexzero committed Dec 30, 2014
1 parent 04ceda8 commit 106b670
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/winston/transports/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 106b670

Please sign in to comment.