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
1 requête de fusion!5Bump to v4.0.0 from upstream
Ce commit fait partie de la requête de fusion !5. Les commentaires créés ici seront créés dans le contexte de cette requête de fusion.
Let file logs correctly ignore modules matching "logging.files[*].disabled" in the configuration file.
...@@ -58,13 +58,13 @@ logging: ...@@ -58,13 +58,13 @@ logging:
lineDateFormat: "MMM-D HH:mm:ss.SSS" # This is in moment.js format lineDateFormat: "MMM-D HH:mm:ss.SSS" # This is in moment.js format
files: files:
- file: "debug.log" - file: "debug.log"
disable: disabled:
- "PresenceHandler" # Will not capture presence logging - "PresenceHandler" # Will not capture presence logging
- file: "warn.log" # Will capture warnings - file: "warn.log" # Will capture warnings
level: "warn" level: "warn"
- file: "botlogs.log" # Will capture logs from DiscordBot - file: "botlogs.log" # Will capture logs from DiscordBot
level: "info" level: "info"
enable: enabled:
- "DiscordBot" - "DiscordBot"
database: database:
# You may either use SQLite or Postgresql for the bridge database, which contains # You may either use SQLite or Postgresql for the bridge database, which contains
......
...@@ -78,7 +78,7 @@ export class Log { ...@@ -78,7 +78,7 @@ export class Log {
private static setupFileTransport(config: LoggingFile): transports.FileTransportInstance { private static setupFileTransport(config: LoggingFile): transports.FileTransportInstance {
config = Object.assign(new LoggingFile(), config); config = Object.assign(new LoggingFile(), config);
const filterOutMods = format((info, _) => { const filterOutMods = format((info, _) => {
if (config.disabled.includes(info.module) && if (config.disabled.includes(info.module) ||
config.enabled.length > 0 && config.enabled.length > 0 &&
!config.enabled.includes(info.module) !config.enabled.includes(info.module)
) { ) {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter