Better browser sniffing suggested at 414f33563d (commitcomment-7936060)
This commit is contained in:
parent
f5e5d577f0
commit
594cc82da1
1 changed files with 3 additions and 8 deletions
|
@ -47,13 +47,8 @@ try {
|
|||
}
|
||||
|
||||
// Are we in the browser (e.g. running via browserify)?
|
||||
var browser;
|
||||
try {
|
||||
window
|
||||
browser = true;
|
||||
} catch (e) {
|
||||
browser = false;
|
||||
}
|
||||
var isBrowser = function () {
|
||||
return typeof (window) !== 'undefined' && this === window; }();
|
||||
|
||||
|
||||
|
||||
|
@ -380,7 +375,7 @@ function Logger(options, _childOptions, _childSimple) {
|
|||
} else if (parent && options.level) {
|
||||
this.level(options.level);
|
||||
} else if (!parent) {
|
||||
if (browser) {
|
||||
if (isBrowser) {
|
||||
/*
|
||||
* In the browser we'll be emitting to console.log by default.
|
||||
* Any console.log worth its salt these days can nicely render
|
||||
|
|
Loading…
Reference in a new issue