diff options
Diffstat (limited to 'lib/utils')
-rw-r--r-- | lib/utils/logger.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/utils/logger.js b/lib/utils/logger.js index a913709..fc9c394 100644 --- a/lib/utils/logger.js +++ b/lib/utils/logger.js @@ -20,7 +20,11 @@ var COLORS = { function Logger(write, logLevel) { if (!(this instanceof Logger)) return new Logger(write, logLevel); - this._write = write || function(msg) { process.stdout.write(msg); }; + this._write = write || function(msg) { + if(process.stdout) { + process.stdout.write(msg); + } + }; this.lastChar = '\n'; this.setLevel(logLevel || 'info'); |