From a837776f32b4e2f5406a7e66bcde546ed89ff773 Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Thu, 14 Sep 2023 18:34:13 -0400 Subject: [PATCH 1/2] Actually ignore logging disabled modules --- changelog.d/902.bugfix | 1 + src/log.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/902.bugfix diff --git a/changelog.d/902.bugfix b/changelog.d/902.bugfix new file mode 100644 index 00000000..b93fa650 --- /dev/null +++ b/changelog.d/902.bugfix @@ -0,0 +1 @@ +Let file logs correctly ignore modules matching "logging.files[*].disabled" in the configuration file. diff --git a/src/log.ts b/src/log.ts index 085b7b22..3aa3c9c6 100644 --- a/src/log.ts +++ b/src/log.ts @@ -78,7 +78,7 @@ export class Log { private static setupFileTransport(config: LoggingFile): transports.FileTransportInstance { config = Object.assign(new LoggingFile(), config); const filterOutMods = format((info, _) => { - if (config.disabled.includes(info.module) && + if (config.disabled.includes(info.module) || config.enabled.length > 0 && !config.enabled.includes(info.module) ) { From 556bb69043d0977d229bf449af57b7106d0ba236 Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Thu, 14 Sep 2023 18:34:42 -0400 Subject: [PATCH 2/2] Fix enabled/disabled log config in sample --- config/config.sample.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.sample.yaml b/config/config.sample.yaml index 3443e4af..27accc19 100644 --- a/config/config.sample.yaml +++ b/config/config.sample.yaml @@ -58,13 +58,13 @@ logging: lineDateFormat: "MMM-D HH:mm:ss.SSS" # This is in moment.js format files: - file: "debug.log" - disable: + disabled: - "PresenceHandler" # Will not capture presence logging - file: "warn.log" # Will capture warnings level: "warn" - file: "botlogs.log" # Will capture logs from DiscordBot level: "info" - enable: + enabled: - "DiscordBot" database: # You may either use SQLite or Postgresql for the bridge database, which contains