Skip to content

Commit 7c729d7

Browse files
authored
fix: change the default logger
Deal with Chrome issue: https://bugs.chromium.org/p/chromium/issues/detail?id=179628
1 parent 406d4e0 commit 7c729d7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/logger/logger.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ var SUPPORTED_METHODS = [
55
];
66

77
function Logger() {
8-
this.setMethods(console);
8+
var defaultMethods = {};
9+
SUPPORTED_METHODS.forEach(function (method) {
10+
// Deal with Chrome issue: https://bugs.chromium.org/p/chromium/issues/detail?id=179628
11+
defaultMethods[method] = console[method].bind(console);
12+
});
13+
this.setMethods(defaultMethods);
914
}
1015
module.exports = Logger;
1116

@@ -15,7 +20,7 @@ Logger.prototype.setMethods = function (overrides) {
1520

1621
SUPPORTED_METHODS.forEach(function (method) {
1722
if (typeof overrides[method] === 'function') {
18-
logger[method] = overrides[method].bind(overrides);
23+
logger[method] = overrides[method];
1924
}
2025
});
2126
};

0 commit comments

Comments
 (0)