Add filter to builtin loggers too
MODIFY
plextraktsync/factory.py
plextraktsync/factory.py
@@ -208,12 +208,23 @@ def logging(self):
def logger(self):
logger = self.logging.getLogger("PlexTraktSync")
config = self.config
+ loggers = [
+ "PlexTraktSync",
+ "PlexTraktSync.BackgroundTask",
+ "PlexTraktSync.EventDispatcher",
+ "PlexTraktSync.PlexServerConnection",
+ "PlexTraktSync.ScrobblerProxy",
+ "PlexTraktSync.Timer",
+ "PlexTraktSync.TraktBatchWorker",
+ "PlexTraktSync.WatchStateUpdater",
+ "PlexTraktSync.WebSocketListener",
+ ]
+ loggers.extend(config["logging"]["filter_loggers"] or [])
from plextraktsync.logger.filter import LoggerFilter
filter = LoggerFilter(config["logging"]["filter"], logger)
- logger.addFilter(filter)
- for name in config["logging"]["filter_loggers"] or []:
+ for name in loggers:
self.logging.getLogger(name).addFilter(filter)
return logger

Add filter to builtin loggers too