把logger中的重复输出塞进debug,删掉调试打印语句

This commit is contained in:
Bakadax
2025-04-27 18:40:17 +08:00
parent 71f35d8f73
commit 60b3187227
5 changed files with 2 additions and 12 deletions

View File

@@ -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:

View File

@@ -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}")

View File

@@ -267,7 +267,7 @@ class Conversation:
):
"""处理规划的行动"""
logger.info(f"执行行动: {action}, 原因: {reason}")
logger.debug(f"执行行动: {action}, 原因: {reason}")
# 记录action历史 (逻辑不变)
current_action_record = {

View File

@@ -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"]

View File

@@ -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