From 5ac20d65ac7b9dcd3e9a91c6ed3ff84d84b5f235 Mon Sep 17 00:00:00 2001 From: veeck Date: Fri, 6 Nov 2020 11:47:09 +0100 Subject: [PATCH] Add new log level "debug" for such a purpose --- CHANGELOG.md | 4 +++- config/config.js.sample | 2 +- js/logger.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b56b1fc6..b6d2fa6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ _This release is scheduled to be released on 2021-01-01._ ### Added +- Added new log level "debug" to the logger. + ### Updated - Weather module - forecast now show TODAY and TOMORROW instead of weekday, to make it easier to understand @@ -229,7 +231,7 @@ Special thanks to @sdetweil for all his great contributions! - Option to show event location in calendar - Finnish translation for "Feels" and "Weeks" -- Russian translation for “Feels” +- Russian translation for "Feels" - Calendar module: added `nextDaysRelative` config option - Add `broadcastPastEvents` config option for calendars to include events from the past `maximumNumberOfDays` in event broadcasts - Added feature to broadcast news feed items `NEWS_FEED` and updated news items `NEWS_FEED_UPDATED` in default [newsfeed](https://github.com/MichMich/MagicMirror/tree/develop/modules/default/newsfeed) module (when news is updated) with documented default and `config.js` options in [README.md](https://github.com/MichMich/MagicMirror/blob/develop/modules/default/newsfeed/README.md) diff --git a/config/config.js.sample b/config/config.js.sample index a0164198..55e84cb4 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -28,7 +28,7 @@ var config = { httpsCertificate: "", // HTTPS Certificate path, only require when useHttps is true language: "en", - logLevel: ["INFO", "LOG", "WARN", "ERROR"], + logLevel: ["DEBUG", "INFO", "LOG", "WARN", "ERROR"], timeFormat: 24, units: "metric", // serverOnly: true/false/"local" , diff --git a/js/logger.js b/js/logger.js index 0f33b473..e9e17c52 100644 --- a/js/logger.js +++ b/js/logger.js @@ -20,10 +20,11 @@ } })(this, function (config) { const logLevel = { + debug: Function.prototype.bind.call(console.debug, console), info: Function.prototype.bind.call(console.info, console), log: Function.prototype.bind.call(console.log, console), - error: Function.prototype.bind.call(console.error, 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),