mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 17:44:52 -04:00
reset changes on js/logger.js, mock logger.js in global_vars tests, workaround for failing dev_console test
This commit is contained in:
parent
e758fd4093
commit
d9edaffd9c
7 changed files with 63 additions and 39 deletions
10
js/logger.js
10
js/logger.js
|
@ -22,7 +22,7 @@
|
|||
root.Log = factory(root.config);
|
||||
}
|
||||
})(this, function (config) {
|
||||
let logLevel = {
|
||||
const 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),
|
||||
|
@ -32,14 +32,10 @@
|
|||
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)
|
||||
timeEnd: Function.prototype.bind.call(console.timeEnd, console),
|
||||
timeStamp: Function.prototype.bind.call(console.timeStamp, console)
|
||||
};
|
||||
|
||||
// the timeStamp instruction fails when running the tests so it is not added in test environment
|
||||
if (typeof process === "object" && process.env.NODE_ENV.trim() !== "test") {
|
||||
logLevel = Object.assign(logLevel, { timeStamp: Function.prototype.bind.call(console.timeStamp, console) });
|
||||
}
|
||||
|
||||
logLevel.setLogLevel = function (newLevel) {
|
||||
if (newLevel) {
|
||||
Object.keys(logLevel).forEach(function (key, index) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue