diff --git a/src/common/logger.py b/src/common/logger.py index a948059ba..8f5e3cbff 100644 --- a/src/common/logger.py +++ b/src/common/logger.py @@ -88,6 +88,25 @@ MEMORY_STYLE_CONFIG = { }, } +# pfc配置 +PFC_STYLE_CONFIG = { + "advanced": { + "console_format": ( + "{time:YYYY-MM-DD HH:mm:ss} | " + "{level: <8} | " + "{extra[module]: <12} | " + "PFC | " + "{message}" + ), + "file_format": "{time:YYYY-MM-DD HH:mm:ss} | {level: <8} | {extra[module]: <15} | PFC | {message}", + }, + "simple": { + "console_format": ( + "{time:MM-DD HH:mm} | PFC | {message}" + ), + "file_format": "{time:YYYY-MM-DD HH:mm:ss} | {level: <8} | {extra[module]: <15} | PFC | {message}", + }, +} # MOOD MOOD_STYLE_CONFIG = { @@ -327,6 +346,7 @@ SUB_HEARTFLOW_STYLE_CONFIG = ( WILLING_STYLE_CONFIG = WILLING_STYLE_CONFIG["simple"] if SIMPLE_OUTPUT else WILLING_STYLE_CONFIG["advanced"] CONFIG_STYLE_CONFIG = CONFIG_STYLE_CONFIG["simple"] if SIMPLE_OUTPUT else CONFIG_STYLE_CONFIG["advanced"] TOOL_USE_STYLE_CONFIG = TOOL_USE_STYLE_CONFIG["simple"] if SIMPLE_OUTPUT else TOOL_USE_STYLE_CONFIG["advanced"] +PFC_STYLE_CONFIG = PFC_STYLE_CONFIG["simple"] if SIMPLE_OUTPUT else PFC_STYLE_CONFIG["advanced"] def is_registered_module(record: dict) -> bool: diff --git a/src/plugins/chat_module/heartFC_chat/heartFC_controler.py b/src/plugins/chat_module/heartFC_chat/heartFC_controler.py index bd7a563d2..389e030a4 100644 --- a/src/plugins/chat_module/heartFC_chat/heartFC_controler.py +++ b/src/plugins/chat_module/heartFC_chat/heartFC_controler.py @@ -3,7 +3,6 @@ from typing import Optional, Dict import asyncio from asyncio import Lock from ...moods.moods import MoodManager -from ....config.config import global_config from ...chat.emoji_manager import emoji_manager from .heartFC_generator import ResponseGenerator from .messagesender import MessageManager diff --git a/src/plugins/chat_module/heartFC_chat/pf_chatting.py b/src/plugins/chat_module/heartFC_chat/pf_chatting.py index 7f082615a..da6c889a9 100644 --- a/src/plugins/chat_module/heartFC_chat/pf_chatting.py +++ b/src/plugins/chat_module/heartFC_chat/pf_chatting.py @@ -9,7 +9,7 @@ from src.plugins.chat.chat_stream import ChatStream from src.plugins.chat.message import UserInfo from src.heart_flow.heartflow import heartflow, SubHeartflow from src.plugins.chat.chat_stream import chat_manager -from src.common.logger import get_module_logger, LogConfig, DEFAULT_CONFIG # 引入 DEFAULT_CONFIG +from src.common.logger import get_module_logger, LogConfig, PFC_STYLE_CONFIG # 引入 DEFAULT_CONFIG from src.plugins.models.utils_model import LLMRequest from src.config.config import global_config from src.plugins.chat.utils_image import image_path_to_base64 # Local import needed after move @@ -17,10 +17,10 @@ from src.plugins.utils.timer_calculater import Timer # <--- Import Timer # 定义日志配置 (使用 loguru 格式) interest_log_config = LogConfig( - console_format=DEFAULT_CONFIG["console_format"], # 使用默认控制台格式 - file_format=DEFAULT_CONFIG["file_format"], # 使用默认文件格式 + console_format=PFC_STYLE_CONFIG["console_format"], # 使用默认控制台格式 + file_format=PFC_STYLE_CONFIG["file_format"], # 使用默认文件格式 ) -logger = get_module_logger("PFChattingLoop", config=interest_log_config) # Logger Name Changed +logger = get_module_logger("PFCLoop", config=interest_log_config) # Logger Name Changed # Forward declaration for type hinting