Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
450 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
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 | // do nothing
|
---|
11 | }
|
---|
12 |
|
---|
13 | logObject[level] = levelExists ? function () {
|
---|
14 | return global.console[level].apply(global.console, arguments);
|
---|
15 | } : (level === 'log' ? function () {} : logObject.log);
|
---|
16 | });
|
---|
17 |
|
---|
18 | module.exports = logObject;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.