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:
@@ -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)
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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} 执行成功")
|
||||
|
||||
Reference in New Issue
Block a user