mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Lint stuff
This commit is contained in:
13
js/logger.js
13
js/logger.js
@@ -7,7 +7,7 @@
|
||||
* MIT Licensed.
|
||||
*/
|
||||
(function (root, factory) {
|
||||
if (typeof exports === 'object') {
|
||||
if (typeof exports === "object") {
|
||||
// add timestamps in front of log messages
|
||||
require("console-stamp")(console, "yyyy-mm-dd HH:MM:ss.l");
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
// Browser globals (root is window)
|
||||
root.Log = factory(root.config);
|
||||
}
|
||||
}(this, function (config) {
|
||||
|
||||
})(this, function (config) {
|
||||
let logLevel = {
|
||||
info: Function.prototype.bind.call(console.info, console),
|
||||
log: Function.prototype.bind.call(console.log, console),
|
||||
@@ -30,15 +29,15 @@
|
||||
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 (config && config.logLevel) {
|
||||
Object.keys(logLevel).forEach(function(key,index) {
|
||||
Object.keys(logLevel).forEach(function (key, index) {
|
||||
if (!config.logLevel.includes(key.toLocaleUpperCase())) {
|
||||
logLevel[key] = function() {};
|
||||
logLevel[key] = function () {};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return logLevel;
|
||||
}));
|
||||
});
|
||||
|
Reference in New Issue
Block a user