We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d131684 commit a8e3384Copy full SHA for a8e3384
lib/utils/log.js
@@ -3,15 +3,16 @@
3
var logObject = {};
4
['log', 'debug', 'warn'].forEach(function (level) {
5
var levelExists;
6
-
+
7
try {
8
- levelExists = global.console && global.console[level] && global.console[level].apply;
9
- } catch(e){}
10
+ levelExists = global.console && global.console[level] && global.console[level].apply;
+ } catch(e) {
+ // do nothing
11
+ }
12
13
logObject[level] = levelExists ? function () {
- return global.console[level].apply(global.console, arguments);
14
+ return global.console[level].apply(global.console, arguments);
15
} : (level === 'log' ? function () {} : logObject.log);
16
});
17
18
module.exports = logObject;
0 commit comments