update common_log.py

This commit is contained in:
TooY 2023-05-29 10:35:34 +08:00
parent 2ee63cab58
commit 2e43b1d097

View file

@ -13,7 +13,7 @@ class MyLogging():
logFile = logPath + logName logFile = logPath + logName
formatter = logging.Formatter('%(asctime)s %(levelname)s: %(message)s') formatter = logging.Formatter('%(asctime)s %(levelname)s: %(message)s')
# handler # handler
time_rotating_file_handler = handlers.TimedRotatingFileHandler(filename=logFile, when='D', encoding='utf-8') time_rotating_file_handler = handlers.TimedRotatingFileHandler(filename=logFile, when="MIDNIGHT", interval=1, encoding='utf-8')
time_rotating_file_handler.setLevel(logging.DEBUG) time_rotating_file_handler.setLevel(logging.DEBUG)
time_rotating_file_handler.setFormatter(formatter) time_rotating_file_handler.setFormatter(formatter)
# config # config