From c9d46f235d3f7b250f16473a1d045e3788ab36be Mon Sep 17 00:00:00 2001 From: Chris Merck Date: Wed, 21 Jun 2023 12:51:57 +0200 Subject: [PATCH] fix: disabled logging --- src/main.ts | 3 ++- src/ts/logger.ts | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 728094c..2dd925e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -14,6 +14,8 @@ declare global { } } +Logger.getInstance().disableLogging(); + window.addEventListener('load', () => { if ('serviceWorker' in navigator) { navigator.serviceWorker @@ -29,7 +31,6 @@ window.addEventListener('load', () => { }); class PwaChat { constructor() { - Logger.getInstance().enableLogging(); IndexedDBManager.getInstance(); Auth.getInstance(); Router.getInstance(); diff --git a/src/ts/logger.ts b/src/ts/logger.ts index 38176d5..e78cb2a 100644 --- a/src/ts/logger.ts +++ b/src/ts/logger.ts @@ -2,9 +2,7 @@ export class Logger { private static instance: Logger; private oldConsoleLog: any = null; - private constructor() { - console.log('[Logger] - instance created'); - } + private constructor() {} static getInstance() { if (!Logger.instance) { @@ -18,10 +16,14 @@ export class Logger { return; } + console.log('[Logger] - logging enabled'); + window['console']['log'] = this.oldConsoleLog; } public disableLogging() { + console.log('[Logger] - logging disabled'); + this.oldConsoleLog = console.log; window['console']['log'] = function () {};