From 0ea21bd183b701a6be63d5e3ed3e26d3ab2768eb Mon Sep 17 00:00:00 2001 From: SolenmeChiara Date: Tue, 4 Nov 2025 22:47:22 -0500 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=BA=94=E7=94=A8maintainer=E7=9A=84?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=BC=98=E5=8C=96=E5=BB=BA=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将maizone调试日志级别从info改为debug - 删除无用的f-string (sourcery-ai建议) - 删除冗余的debug日志 - 优化send_handler日志级别 Co-authored-by: minecraft1024a <140055845+minecraft1024a@users.noreply.github.com> --- .../built_in/maizone_refactored/services/content_service.py | 6 +++--- .../built_in/maizone_refactored/services/cookie_service.py | 1 - .../built_in/maizone_refactored/services/qzone_service.py | 2 +- .../built_in/napcat_adapter_plugin/src/send_handler.py | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/plugins/built_in/maizone_refactored/services/content_service.py b/src/plugins/built_in/maizone_refactored/services/content_service.py index b686ab696..0da66b09f 100644 --- a/src/plugins/built_in/maizone_refactored/services/content_service.py +++ b/src/plugins/built_in/maizone_refactored/services/content_service.py @@ -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) diff --git a/src/plugins/built_in/maizone_refactored/services/cookie_service.py b/src/plugins/built_in/maizone_refactored/services/cookie_service.py index 444ef6852..3f45dc3c8 100644 --- a/src/plugins/built_in/maizone_refactored/services/cookie_service.py +++ b/src/plugins/built_in/maizone_refactored/services/cookie_service.py @@ -139,7 +139,6 @@ class CookieService: if cookies: logger.info(f"成功从Adapter API为 {qq_account} 获取Cookie,keys={list(cookies.keys())}") self._save_cookies_to_file(qq_account, cookies) - logger.info(f"[DEBUG] Cookie已保存,即将返回") return cookies logger.error( diff --git a/src/plugins/built_in/maizone_refactored/services/qzone_service.py b/src/plugins/built_in/maizone_refactored/services/qzone_service.py index e39951ea4..800bdfee0 100644 --- a/src/plugins/built_in/maizone_refactored/services/qzone_service.py +++ b/src/plugins/built_in/maizone_refactored/services/qzone_service.py @@ -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) diff --git a/src/plugins/built_in/napcat_adapter_plugin/src/send_handler.py b/src/plugins/built_in/napcat_adapter_plugin/src/send_handler.py index dc070d3cc..2a055599c 100644 --- a/src/plugins/built_in/napcat_adapter_plugin/src/send_handler.py +++ b/src/plugins/built_in/napcat_adapter_plugin/src/send_handler.py @@ -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} 执行成功")