refactor: 清理后端诊断输出

This commit is contained in:
2026-06-25 12:08:45 +08:00
parent 4c713d177c
commit be19dbc888
4 changed files with 24 additions and 8 deletions
+5 -1
View File
@@ -2,6 +2,7 @@
数据处理核心模块
"""
import chardet
import logging
import os
import re
import shutil
@@ -21,6 +22,9 @@ from app.database import DatabaseManager
from app.utils.file_dates import DirectoryDateSelection, select_recent_items_by_directory
logger = logging.getLogger(__name__)
class ProcessLogger:
"""处理日志记录器"""
@@ -53,7 +57,7 @@ class ProcessLogger:
f.write(entry + "\n")
except Exception as e:
# 如果写入失败,至少记录到内存
print(f"写入日志文件失败: {e}")
logger.warning("Failed to write process log file: %s", e)
if self.callback:
self.callback(entry)