251108问题修复
This commit is contained in:
@ -55,6 +55,15 @@ class Logger(QObject):
|
||||
handler.setFormatter(formatter)
|
||||
self.logger_file_info.addHandler(handler)
|
||||
|
||||
# 添加错误专用日志文件
|
||||
error_handler = TimedRotatingFileHandler(
|
||||
file_path.replace('.log', '_error.log'),
|
||||
when='D', interval=1, backupCount=30, encoding='utf-8')
|
||||
error_handler.suffix = "%Y-%m-%d"
|
||||
error_handler.setLevel(logging.ERROR) # 只处理错误级别
|
||||
error_handler.setFormatter(formatter)
|
||||
self.logger_file_info.addHandler(error_handler)
|
||||
|
||||
def _process_logs(self):
|
||||
while True:
|
||||
time.sleep(0.1)
|
||||
|
||||
Reference in New Issue
Block a user