Fix bug resulting in duplicate logging when using verbose

main
Alexander Neff 2023-01-25 19:28:12 +01:00 committed by mpgn
parent e84f589902
commit db5a36f4b5
1 changed files with 1 additions and 2 deletions

View File

@ -115,14 +115,13 @@ def setup_debug_logger():
streamHandler.setFormatter(formatter) streamHandler.setFormatter(formatter)
root_logger = logging.getLogger() root_logger = logging.getLogger()
root_logger.propagate = False root_logger.handlers = []
root_logger.addHandler(streamHandler) root_logger.addHandler(streamHandler)
#root_logger.addHandler(fileHandler) #root_logger.addHandler(fileHandler)
root_logger.setLevel(logging.DEBUG) root_logger.setLevel(logging.DEBUG)
return root_logger return root_logger
def setup_logger(level=logging.INFO, log_to_file=False, log_prefix=None, logger_name='CME'): def setup_logger(level=logging.INFO, log_to_file=False, log_prefix=None, logger_name='CME'):
formatter = logging.Formatter("%(message)s") formatter = logging.Formatter("%(message)s")
if log_to_file: if log_to_file: