Skip to content

Commit

Permalink
Changed: log to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Feb 2, 2012
1 parent a73176b commit a9e7bad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,16 @@ function debug(name) {
+ fmt + '\033[3' + c + 'm'
+ ' ' + pad(ms, 40 - fmt.length) + 'ms\033[0m';

console.log.apply(this, arguments);
console.error.apply(this, arguments);
}

function plain(fmt) {
fmt = new Date().toUTCString()
+ ' ' + name + ' ' + fmt;
console.log.apply(this, arguments);
console.error.apply(this, arguments);
}

return isatty ? colored : plain;
return isatty
? colored
: plain;
}

0 comments on commit a9e7bad

Please sign in to comment.