From 60b3187227241000b3daf810d311fa4468dbc592 Mon Sep 17 00:00:00 2001 From: Bakadax Date: Sun, 27 Apr 2025 18:40:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=8Alogger=E4=B8=AD=E7=9A=84=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E8=BE=93=E5=87=BA=E5=A1=9E=E8=BF=9Bdebug=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E6=8E=89=E8=B0=83=E8=AF=95=E6=89=93=E5=8D=B0=E8=AF=AD?= =?UTF-8?q?=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/PFC/chat_observer.py | 2 -- src/plugins/PFC/chat_states.py | 6 ------ src/plugins/PFC/conversation.py | 2 +- src/plugins/PFC/observation_info.py | 2 -- src/plugins/PFC/reply_generator.py | 2 +- 5 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/plugins/PFC/chat_observer.py b/src/plugins/PFC/chat_observer.py index 697833c84..0305289fa 100644 --- a/src/plugins/PFC/chat_observer.py +++ b/src/plugins/PFC/chat_observer.py @@ -94,11 +94,9 @@ class ChatObserver: """ try: # 发送新消息通知 - # logger.info(f"发送新ccchandleer消息通知: {message}") notification = create_new_message_notification( sender="chat_observer", target="observation_info", message=message ) - # logger.info(f"发送新消ddddd息通知: {notification}") # print(self.notification_manager) await self.notification_manager.send_notification(notification) except Exception as e: diff --git a/src/plugins/PFC/chat_states.py b/src/plugins/PFC/chat_states.py index 1f8ee15fb..4b839b7bd 100644 --- a/src/plugins/PFC/chat_states.py +++ b/src/plugins/PFC/chat_states.py @@ -98,15 +98,11 @@ class NotificationManager: notification_type: 要处理的通知类型 handler: 处理器实例 """ - # print(1145145511114445551111444) if target not in self._handlers: - # print("没11有target") self._handlers[target] = {} if notification_type not in self._handlers[target]: - # print("没11有notification_type") self._handlers[target][notification_type] = [] # print(self._handlers[target][notification_type]) - # print(f"注册1111111111111111111111处理器: {target} {notification_type} {handler}") self._handlers[target][notification_type].append(handler) # print(self._handlers[target][notification_type]) @@ -132,7 +128,6 @@ class NotificationManager: async def send_notification(self, notification: Notification): """发送通知""" self._notification_history.append(notification) - # print("kaishichul-----------------------------------i") # 如果是状态通知,更新活跃状态 if isinstance(notification, StateNotification): @@ -145,7 +140,6 @@ class NotificationManager: target = notification.target if target in self._handlers: handlers = self._handlers[target].get(notification.type, []) - # print(1111111) # print(handlers) for handler in handlers: # print(f"调用处理器: {handler}") diff --git a/src/plugins/PFC/conversation.py b/src/plugins/PFC/conversation.py index b1fe0731c..394fc1d74 100644 --- a/src/plugins/PFC/conversation.py +++ b/src/plugins/PFC/conversation.py @@ -267,7 +267,7 @@ class Conversation: ): """处理规划的行动""" - logger.info(f"执行行动: {action}, 原因: {reason}") + logger.debug(f"执行行动: {action}, 原因: {reason}") # 记录action历史 (逻辑不变) current_action_record = { diff --git a/src/plugins/PFC/observation_info.py b/src/plugins/PFC/observation_info.py index 072b1fb6f..050d839fb 100644 --- a/src/plugins/PFC/observation_info.py +++ b/src/plugins/PFC/observation_info.py @@ -140,7 +140,6 @@ class ObservationInfo: self.chat_observer.notification_manager.register_handler( target="observation_info", notification_type=NotificationType.COLD_CHAT, handler=self.handler ) - print("1919810------------------------绑定-----------------------------") def unbind_from_chat_observer(self): """解除与chat_observer的绑定""" @@ -159,7 +158,6 @@ class ObservationInfo: Args: message: 消息数据 """ - # print("1919810-----------------------------------------------------") # logger.debug(f"更新信息from_message: {message}") self.last_message_time = message["time"] self.last_message_id = message["message_id"] diff --git a/src/plugins/PFC/reply_generator.py b/src/plugins/PFC/reply_generator.py index 0035f845e..59e261ac5 100644 --- a/src/plugins/PFC/reply_generator.py +++ b/src/plugins/PFC/reply_generator.py @@ -162,7 +162,7 @@ class ReplyGenerator: logger.debug(f"发送到LLM的生成提示词:\n------\n{prompt}\n------") try: content, _ = await self.llm.generate_response_async(prompt) - logger.info(f"生成的回复: {content}") + logger.debug(f"生成的回复: {content}") # 移除旧的检查新消息逻辑,这应该由 conversation 控制流处理 return content