mirror of
https://github.com/MichMich/MagicMirror.git
synced 2026-04-23 14:27:01 +00:00
After #4049 here are two small follow-up improvements to `js/logger.js`. **1. Simpler bind syntax** — `Function.prototype.bind.call(console.debug, console)` is an archaic pattern. The equivalent `console.debug.bind(console)` works fine in all supported engines (Node.js ≥ 22, modern browsers) and is much easier to read. Also: `console.timeStamp` exists in all supported environments, so the conditional fallback to an empty function is no longer needed. **2. Simpler `setLogLevel`** — instead of iterating over all keys in the logger object and permanently overwriting them, the method now loops over the five log-level keys explicitly and rebinds from `console[key]`. This makes the filtered set obvious at a glance and ensures utility methods like `group`, `time`, and `timeStamp` are never accidentally silenced — they're structural helpers, not log levels.