Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider a546c1bf rédigé par Andrew Ferrazzutti's avatar Andrew Ferrazzutti Validation de GitHub
Parcourir les fichiers

Actually ignore logging disabled modules (#902)

* Actually ignore logging disabled modules

* Fix enabled/disabled log config in sample
parent 92f528e8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Let file logs correctly ignore modules matching "logging.files[*].disabled" in the configuration file.
......@@ -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
......
......@@ -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)
) {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter