Skip to content

Commit

Permalink
Actually ignore logging disabled modules (#902)
Browse files Browse the repository at this point in the history
* Actually ignore logging disabled modules

* Fix enabled/disabled log config in sample
  • Loading branch information
AndrewFerr authored Sep 15, 2023
1 parent 92f528e commit a546c1b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.d/902.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Let file logs correctly ignore modules matching "logging.files[*].disabled" in the configuration file.
4 changes: 2 additions & 2 deletions config/config.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
) {
Expand Down

0 comments on commit a546c1b

Please # to comment.