251108问题修复

This commit is contained in:
2025-11-08 20:38:55 +08:00
parent b66b31d9ad
commit e54c8d6f5e
27 changed files with 613 additions and 51 deletions

View File

@ -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)