重构跨多个模块的日志配置
- 将“get_module_logger”替换为新模块“logger_manager”中的“get_logger”,以实现一致的日志设置。 - 移除了单独的日志配置设置,转而采用集中式日志管理。 - 更新了多个文件中的日志初始化方法,包括“config.py”、“change_mood.py”、“change_relationship.py”等,以简化日志记录实践。 - 引入“logger_manager.py”,用于根据模块特定的样式处理日志配置。
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from src.common.logger import get_module_logger, LogConfig, RELATION_STYLE_CONFIG
|
||||
from src.common.logger_manager import get_logger
|
||||
from ..chat.chat_stream import ChatStream
|
||||
import math
|
||||
from bson.decimal128 import Decimal128
|
||||
@@ -7,12 +7,8 @@ import time
|
||||
import re
|
||||
import traceback
|
||||
|
||||
relationship_config = LogConfig(
|
||||
# 使用关系专用样式
|
||||
console_format=RELATION_STYLE_CONFIG["console_format"],
|
||||
file_format=RELATION_STYLE_CONFIG["file_format"],
|
||||
)
|
||||
logger = get_module_logger("rel_manager", config=relationship_config)
|
||||
|
||||
logger = get_logger("relation")
|
||||
|
||||
|
||||
class RelationshipManager:
|
||||
|
||||
Reference in New Issue
Block a user