diff --git a/changelog.d/902.bugfix b/changelog.d/902.bugfix new file mode 100644 index 0000000000000000000000000000000000000000..b93fa650c3a7b19feecb80ffd8f7487445e9fa9a --- /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/config/config.sample.yaml b/config/config.sample.yaml index 3443e4afbc8a0d9c5e481c75c3fc4e775d3e41b8..27accc194b7eb67aa308fcb2986a423fe47019f3 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 diff --git a/src/log.ts b/src/log.ts index 085b7b223634139d70d020bfb9dee8ce71a4d67a..3aa3c9c6d11d31444ea750b243008ee5d8178129 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) ) {