-
Notifications
You must be signed in to change notification settings - Fork 1
Simplify logging in utils.py #80
Copy link
Copy link
Open
Description
# Class to be used to add our TaskFieldFilter to any new loggers
class TaskFieldLogger(logging.getLoggerClass()):
def __init__(self, name):
super().__init__(name)
self.addFilter(TaskFieldFilter())
# Set class to be used for instantiating loggers
logging.setLoggerClass(TaskFieldLogger)
logging.getLogger().addFilter(TaskFieldFilter()) # Add filter on root logger
quest_logger = logging.getLogger('quest') # Create custom quest logger
# Add filter on any existing loggers
for logger_name in logging.root.manager.loggerDict.keys():
logger = logging.getLogger(logger_name)
logger.addFilter(TaskFieldFilter())- [byubean] For backlog: my hunch is this could be a little more straightforward. This smells like we don't quite know what we're doing, but we found something that worked and ran with it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels