mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +00:00
Check for stdout, for browser compatibility
This commit is contained in:
+5
-1
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user