From d605ee07f2280b643891f9f6fefd3ad71b5e903a Mon Sep 17 00:00:00 2001 From: powermaker450 Date: Wed, 21 Aug 2024 14:32:43 -0400 Subject: [PATCH] Fix logging levels --- src/utils/logger.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/utils/logger.ts b/src/utils/logger.ts index c9f33d3..8a92dd2 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -18,7 +18,7 @@ export class Logger { } public log(text?: any, args?: any): void { - if (this.isMainFunction || this._logLevel === 0) { + if (this.isMainFunction || this._logLevel > 2) { args ? console.log(this._main + text, args) : console.log(this._main + text); @@ -26,7 +26,7 @@ export class Logger { } public warn(text?: any, args?: any): void { - if (this._logLevel === 1) { + if (this._logLevel > 1) { args ? console.warn(this._main + this._wrn + text, args) : console.warn(this._main + this._wrn + text); @@ -34,11 +34,9 @@ export class Logger { } public error(text?: any, args?: any): void { - if (this._logLevel === 2) { - args - ? console.error(this._main + this._err + text, args) - : console.error(this._main + this._err + text); - } + args + ? console.error(this._main + this._err + text, args) + : console.error(this._main + this._err + text); } }