Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Actually ignore logging disabled modules #902

Merged
merged 3 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading