refactor(logger): 为base_tool和person_info模块添加自定义日志配置

为base_tool和person_info模块引入自定义日志配置,提升日志输出的可读性和一致性。分别在logger.py中新增BASE_TOOL_STYLE_CONFIG和PERSON_INFO_STYLE_CONFIG配置,并在相应模块中应用这些配置。
This commit is contained in:
墨梓柒
2025-04-23 23:24:08 +08:00
parent 7281c13a12
commit 6da2a77b78
3 changed files with 52 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
from src.common.logger import get_module_logger
from src.common.logger import get_module_logger, LogConfig, PERSON_INFO_STYLE_CONFIG
from ...common.database import db
import copy
import hashlib
@@ -33,7 +33,12 @@ PersonInfoManager 类方法功能摘要:
9. personal_habit_deduction - 定时推断个人习惯
"""
logger = get_module_logger("person_info")
person_info_log_config = LogConfig(
console_format=PERSON_INFO_STYLE_CONFIG["console_format"],
file_format=PERSON_INFO_STYLE_CONFIG["file_format"],
)
logger = get_module_logger("person_info", config=person_info_log_config)
person_info_default = {
"person_id": None,