feat: 增强日志功能并添加rich依赖

- 添加rich库依赖以改进日志显示
- 在各模块添加详细调试日志,包括消息处理、命令执行和工具调用过程
- 使用RichHandler美化日志输出并抑制第三方库的噪音日志
- 在关键路径添加日志记录,便于问题排查
This commit is contained in:
Yuyao Huang (Sam)
2026-03-28 07:57:24 +08:00
parent 0eb29f2dcc
commit b67e2dd2db
5 changed files with 47 additions and 8 deletions
+6 -1
View File
@@ -47,7 +47,12 @@ async def send_text(receive_id: str, receive_id_type: str, text: str) -> None:
text: message content.
"""
import json as _json
content = _json.dumps({"text": _truncate(text)}, ensure_ascii=False)
truncated = _truncate(text)
logger.debug(
"[feishu] send_text to=%s type=%s len=%d/%d text=%r",
receive_id, receive_id_type, len(truncated), len(text), truncated[:120],
)
content = _json.dumps({"text": truncated}, ensure_ascii=False)
request = (
CreateMessageRequest.builder()