chore: 应用maintainer的日志优化建议

- 将maizone调试日志级别从info改为debug
- 删除无用的f-string (sourcery-ai建议)
- 删除冗余的debug日志
- 优化send_handler日志级别

Co-authored-by: minecraft1024a <140055845+minecraft1024a@users.noreply.github.com>
This commit is contained in:
SolenmeChiara
2025-11-04 22:47:22 -05:00
parent 1b571e30ac
commit 0ea21bd183
4 changed files with 6 additions and 7 deletions

View File

@@ -205,7 +205,7 @@ class ContentService:
if success and reply_set:
reply = "".join([content for type, content in reply_set if type == "text"])
logger.info(f"成功为'{commenter_name}'的评论生成回复: '{reply}'")
logger.debug(f"成功为'{commenter_name}'的评论生成回复: '{reply}'")
return reply
else:
if i < 2:
@@ -287,8 +287,8 @@ class ContentService:
text_model = str(self.get_config("models.text_model", "replyer"))
# 调试日志
logger.info(f"[DEBUG] 读取到的text_model配置: '{text_model}'")
logger.info(f"[DEBUG] 可用模型列表: {list(models.keys())[:10]}...") # 只显示前10个
logger.debug(f"[DEBUG] 读取到的text_model配置: '{text_model}'")
logger.debug(f"[DEBUG] 可用模型列表: {list(models.keys())[:10]}...") # 只显示前10个
model_config = models.get(text_model)

View File

@@ -139,7 +139,6 @@ class CookieService:
if cookies:
logger.info(f"成功从Adapter API为 {qq_account} 获取Cookiekeys={list(cookies.keys())}")
self._save_cookies_to_file(qq_account, cookies)
logger.info(f"[DEBUG] Cookie已保存即将返回")
return cookies
logger.error(

View File

@@ -274,7 +274,7 @@ class QZoneService:
# 检查是否是Cookie失效-3000错误
if "错误码: -3000" in error_msg and retry_count == 0:
logger.warning(f"检测到Cookie失效-3000错误准备删除缓存并重试...")
logger.warning("检测到Cookie失效-3000错误准备删除缓存并重试...")
# 删除Cookie缓存文件
cookie_file = self.cookie_service._get_cookie_file_path(qq_account)

View File

@@ -202,9 +202,9 @@ class SendHandler:
response = await self.send_message_to_napcat(action, params)
# 发送响应回MoFox-Bot
logger.info(f"[DEBUG handle_adapter_command] 即将调用send_adapter_command_response, request_id={request_id}")
logger.debug(f"[DEBUG handle_adapter_command] 即将调用send_adapter_command_response, request_id={request_id}")
await self.send_adapter_command_response(raw_message_base, response, request_id)
logger.info(f"[DEBUG handle_adapter_command] send_adapter_command_response调用完成")
logger.debug(f"[DEBUG handle_adapter_command] send_adapter_command_response调用完成")
if response.get("status") == "ok":
logger.info(f"适配器命令 {action} 执行成功")