Merge pull request #431 from UnCLAS-Prommer/main-fix

fix: 截断log,出于日志可读性考虑
This commit is contained in:
tcmofashi
2025-03-16 14:15:45 +08:00
committed by GitHub
2 changed files with 8 additions and 3 deletions

2
.gitignore vendored
View File

@@ -211,3 +211,5 @@ jieba.cache
# If using PyEnv and configured to use a specific Python version locally # If using PyEnv and configured to use a specific Python version locally
# a .local-version file will be created in the root of the project to specify the version. # a .local-version file will be created in the root of the project to specify the version.
.python-version .python-version
OtherRes.txt

View File

@@ -210,12 +210,15 @@ class ChatBot:
is_head=not mark_head, is_head=not mark_head,
is_emoji=False, is_emoji=False,
) )
logger.debug(f"bot_message: {bot_message}")
if not mark_head: if not mark_head:
mark_head = True mark_head = True
logger.debug(f"添加消息到message_set: {bot_message}")
message_set.add_message(bot_message) message_set.add_message(bot_message)
if len(str(bot_message)) < 1000:
logger.debug(f"bot_message: {bot_message}")
logger.debug(f"添加消息到message_set: {bot_message}")
else:
logger.debug(f"bot_message: {str(bot_message)[:1000]}...{str(bot_message)[-10:]}")
logger.debug(f"添加消息到message_set: {str(bot_message)[:1000]}...{str(bot_message)[-10:]}")
# message_set 可以直接加入 message_manager # message_set 可以直接加入 message_manager
# print(f"\033[1;32m[回复]\033[0m 将回复载入发送容器") # print(f"\033[1;32m[回复]\033[0m 将回复载入发送容器")