From c9ba0be2c579c801e6a03c8402a2a13004d0b6e1 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 9 Oct 2024 14:45:02 +0800 Subject: [PATCH] refactor logger for clarity --- Client/src/Utils/Logger.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Client/src/Utils/Logger.js b/Client/src/Utils/Logger.js index aaf4eec4e..a3cb9bc16 100644 --- a/Client/src/Utils/Logger.js +++ b/Client/src/Utils/Logger.js @@ -22,6 +22,7 @@ class Logger { } if (logLevel === "error") { + this.error = console.error.bind(console); this.info = NO_OP; this.warn = NO_OP; this.log = NO_OP; @@ -29,20 +30,20 @@ class Logger { } if (logLevel === "warn") { + this.error = console.error.bind(console); + this.warn = console.warn.bind(console); this.info = NO_OP; this.log = NO_OP; return; } if (logLevel === "info") { + this.error = console.error.bind(console); + this.warn = console.warn.bind(console); + this.info = console.info.bind(console); this.log = NO_OP; return; } - - this.error = console.error.bind(console); - this.warn = console.warn.bind(console); - this.info = console.info.bind(console); - this.log = console.log.bind(console); } cleanup() {