From 80853771f4c647725d7823965aff625ad876cb42 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Mon, 31 Jul 2023 01:29:04 +0200 Subject: [PATCH] Removing debug logging --- src/backend/middlewares/admin/SettingsMWs.ts | 16 ---------------- src/common/config/private/Config.ts | 3 --- src/common/config/private/PrivateConfig.ts | 2 -- .../unit/middlewares/admin/SettingsMWs.ts | 3 --- 4 files changed, 24 deletions(-) diff --git a/src/backend/middlewares/admin/SettingsMWs.ts b/src/backend/middlewares/admin/SettingsMWs.ts index 651de094..a099f022 100644 --- a/src/backend/middlewares/admin/SettingsMWs.ts +++ b/src/backend/middlewares/admin/SettingsMWs.ts @@ -28,8 +28,6 @@ export class SettingsMWs { let settings = req.body.settings; // Top level settings JSON const settingsPath: string = req.body.settingsPath; // Name of the top level settings const transformer = await Config.original(); - console.log('pre settings' + settingsPath); - console.log(settings); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore transformer[settingsPath] = settings; @@ -38,29 +36,15 @@ export class SettingsMWs { settings = ConfigClassBuilder.attachPrivateInterface(transformer[settingsPath]).toJSON({ skipTags: {secret: true} as TAGS }); - console.log('post settings'+ settingsPath); - console.log(settings); const original = await Config.original(); - console.log('orig pre'); - console.log(ConfigClassBuilder.attachPrivateInterface(original.Messaging).toJSON()); - console.log(original.Messaging.Email); - console.log(original.Messaging.Email.type); // only updating explicitly set config (not saving config set by the diagnostics) // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore original[settingsPath] = settings; - console.log('orig'); - console.log(ConfigClassBuilder.attachPrivateInterface(original.Messaging).toJSON()); - console.log(original.Messaging.Email); - console.log(original.Messaging.Email.type); await ConfigDiagnostics.testConfig(original); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore Config[settingsPath] = settings; - console.log('Config'); - console.log(Config.Messaging); - console.log(Config.Messaging.Email); - console.log(Config.Messaging.Email.type); await original.save(); await ConfigDiagnostics.runDiagnostics(); Logger.info(LOG_TAG, 'new config:'); diff --git a/src/common/config/private/Config.ts b/src/common/config/private/Config.ts index 97c22eed..4a5a02ea 100644 --- a/src/common/config/private/Config.ts +++ b/src/common/config/private/Config.ts @@ -82,15 +82,12 @@ export class PrivateConfigClass extends ServerConfig { require('../../../../package.json').buildCommitHash; this.Environment.upTime = upTime; this.Environment.isDocker = !!process.env.PI_DOCKER; - console.log('CONFIG', ServerEnvironment); if (typeof ServerEnvironment.sendMailAvailable !== 'undefined') { this.Environment.sendMailAvailable = ServerEnvironment.sendMailAvailable; if (!this.Environment.sendMailAvailable) { //onNewValue is not yet available as a callback this.Messaging.Email.type = EmailMessagingType.SMTP; } } - console.log('CONFIG', this.Environment.sendMailAvailable); - console.log('CONFIG', this.Messaging.Email.type); } async original(): Promise { diff --git a/src/common/config/private/PrivateConfig.ts b/src/common/config/private/PrivateConfig.ts index ffd81878..e9b60a19 100644 --- a/src/common/config/private/PrivateConfig.ts +++ b/src/common/config/private/PrivateConfig.ts @@ -1054,11 +1054,9 @@ export class ServerEnvironmentConfig { @ConfigProperty({ volatile: true, onNewValue: (value, config) => { - console.log('onNewValue', value, config.Messaging.Email.type); if (value === false) { config.Messaging.Email.type = EmailMessagingType.SMTP; } - console.log('onNewValue after', value, config.Messaging.Email.type); }, description: 'App updates on start-up if sendmail binary is available' }) diff --git a/test/backend/unit/middlewares/admin/SettingsMWs.ts b/test/backend/unit/middlewares/admin/SettingsMWs.ts index 1874987a..db0b689a 100644 --- a/test/backend/unit/middlewares/admin/SettingsMWs.ts +++ b/test/backend/unit/middlewares/admin/SettingsMWs.ts @@ -26,7 +26,6 @@ describe('Settings middleware', () => { }); it('should save empty enforced users settings', (done: (err?: any) => void) => { - console.log('sarting - should save empty enforced users settings'); ServerEnvironment.sendMailAvailable = false; Config.Environment.sendMailAvailable = false; Config.Messaging.Email.type = EmailMessagingType.SMTP; @@ -40,7 +39,6 @@ describe('Settings middleware', () => { settings: ConfigClassBuilder.attachPrivateInterface(new ServerUserConfig()).toJSON() } }; - console.log('Settings', req); req.body.settings.enforcedUsers = []; const next: any = (err: ErrorDTO) => { try { @@ -57,7 +55,6 @@ describe('Settings middleware', () => { }); it('should save enforced users settings', (done: (err?: any) => void) => { - console.log('sarting - should save enforced users settings'); ServerEnvironment.sendMailAvailable = false; Config.Environment.sendMailAvailable = false;