mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
fix logger.js
This commit is contained in:
parent
53c789bff9
commit
d7c70dc021
43
js/logger.js
43
js/logger.js
@ -22,34 +22,21 @@
|
|||||||
root.Log = factory(root.config);
|
root.Log = factory(root.config);
|
||||||
}
|
}
|
||||||
})(this, function (config) {
|
})(this, function (config) {
|
||||||
let logLevel;
|
let logLevel = {
|
||||||
if (process.env.JEST_WORKER_ID === undefined) {
|
debug: Function.prototype.bind.call(console.debug, console),
|
||||||
logLevel = {
|
log: Function.prototype.bind.call(console.log, console),
|
||||||
debug: Function.prototype.bind.call(console.debug, console),
|
info: Function.prototype.bind.call(console.info, console),
|
||||||
log: Function.prototype.bind.call(console.log, console),
|
warn: Function.prototype.bind.call(console.warn, console),
|
||||||
info: Function.prototype.bind.call(console.info, console),
|
error: Function.prototype.bind.call(console.error, console),
|
||||||
warn: Function.prototype.bind.call(console.warn, console),
|
group: Function.prototype.bind.call(console.group, console),
|
||||||
error: Function.prototype.bind.call(console.error, console),
|
groupCollapsed: Function.prototype.bind.call(console.groupCollapsed, console),
|
||||||
group: Function.prototype.bind.call(console.group, console),
|
groupEnd: Function.prototype.bind.call(console.groupEnd, console),
|
||||||
groupCollapsed: Function.prototype.bind.call(console.groupCollapsed, console),
|
time: Function.prototype.bind.call(console.time, console),
|
||||||
groupEnd: Function.prototype.bind.call(console.groupEnd, console),
|
timeEnd: Function.prototype.bind.call(console.timeEnd, console)
|
||||||
time: Function.prototype.bind.call(console.time, console),
|
};
|
||||||
timeEnd: Function.prototype.bind.call(console.timeEnd, console),
|
|
||||||
timeStamp: Function.prototype.bind.call(console.timeStamp, console)
|
if ((typeof exports === "object" && process.env.JEST_WORKER_ID === undefined) || typeof exports !== "object") {
|
||||||
};
|
logLevel.timeStamp = Function.prototype.bind.call(console.timeStamp, console);
|
||||||
} else {
|
|
||||||
logLevel = {
|
|
||||||
debug: Function.prototype.bind.call(console.debug, console),
|
|
||||||
log: Function.prototype.bind.call(console.log, console),
|
|
||||||
info: Function.prototype.bind.call(console.info, console),
|
|
||||||
warn: Function.prototype.bind.call(console.warn, console),
|
|
||||||
error: Function.prototype.bind.call(console.error, console),
|
|
||||||
group: Function.prototype.bind.call(console.group, console),
|
|
||||||
groupCollapsed: Function.prototype.bind.call(console.groupCollapsed, console),
|
|
||||||
groupEnd: Function.prototype.bind.call(console.groupEnd, console),
|
|
||||||
time: Function.prototype.bind.call(console.time, console),
|
|
||||||
timeEnd: Function.prototype.bind.call(console.timeEnd, console)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logLevel.setLogLevel = function (newLevel) {
|
logLevel.setLogLevel = function (newLevel) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user