feat(logger): 为聊天流模块添加自定义日志配置

新增 `CHAT_STREAM_STYLE_CONFIG` 配置,用于定义聊天流模块的日志格式,包括控制台和文件输出的样式。同时更新 `chat_stream.py` 以使用该配置,确保日志输出风格一致且易于识别。
This commit is contained in:
墨梓柒
2025-04-24 11:21:07 +08:00
parent 49c4d77c97
commit 12de69fb3c
2 changed files with 26 additions and 2 deletions

View File

@@ -8,9 +8,14 @@ from typing import Dict, Optional
from ...common.database import db
from ..message.message_base import GroupInfo, UserInfo
from src.common.logger import get_module_logger
from src.common.logger import get_module_logger, LogConfig, CHAT_STREAM_STYLE_CONFIG
logger = get_module_logger("chat_stream")
chat_stream_log_config = LogConfig(
console_format=CHAT_STREAM_STYLE_CONFIG["console_format"],
file_format=CHAT_STREAM_STYLE_CONFIG["file_format"],
)
logger = get_module_logger("chat_stream", config=chat_stream_log_config)
class ChatStream: