refactor: 清理后端诊断输出
This commit is contained in:
+5
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user