From 71b4cf57c397f9ced427edbf8b9a922e5e5d4bfa Mon Sep 17 00:00:00 2001 From: zhayujie Date: Tue, 20 Dec 2022 22:25:03 +0800 Subject: [PATCH] fix: adjust log level --- README.md | 2 +- channel/wechat/wechat_channel.py | 4 ++-- common/log.py | 2 +- config-template.json | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5f00a98..89cf178 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ - [x] **文本对话:** 接收私聊及群组中的微信消息,使用ChatGPT生成回复内容,完成自动回复 - [x] **规则定制化:** 支持私聊中按指定规则触发自动回复,支持对群组设置自动回复白名单 - [x] **多账号:** 支持多微信账号同时运行 -- [x] **图片生成:** 支持根据描述生成图片,并自动发送至个人聊天或群聊 +- [x] **图片生成:** 支持根据描述生成图片,并自动发送至个人聊天或群聊 # 更新日志 diff --git a/channel/wechat/wechat_channel.py b/channel/wechat/wechat_channel.py index af376ec..fa7b828 100644 --- a/channel/wechat/wechat_channel.py +++ b/channel/wechat/wechat_channel.py @@ -40,7 +40,7 @@ class WechatChannel(Channel): itchat.run() def handle(self, msg): - logger.info("[WX]receive msg: " + json.dumps(msg, ensure_ascii=False)) + logger.debug("[WX]receive msg: " + json.dumps(msg, ensure_ascii=False)) from_user_id = msg['FromUserName'] to_user_id = msg['ToUserName'] # 接收人id other_user_id = msg['User']['UserName'] # 对手方id @@ -73,7 +73,7 @@ class WechatChannel(Channel): def handle_group(self, msg): - logger.info("[WX]receive group msg: " + json.dumps(msg, ensure_ascii=False)) + logger.debug("[WX]receive group msg: " + json.dumps(msg, ensure_ascii=False)) group_name = msg['User'].get('NickName', None) group_id = msg['User'].get('UserName', None) if not group_name: diff --git a/common/log.py b/common/log.py index 90a6c55..e00456e 100644 --- a/common/log.py +++ b/common/log.py @@ -4,7 +4,7 @@ import sys def _get_logger(): log = logging.getLogger('log') - log.setLevel(logging.DEBUG) + log.setLevel(logging.INFO) console_handle = logging.StreamHandler(sys.stdout) console_handle.setFormatter(logging.Formatter('[%(levelname)s][%(asctime)s][%(filename)s:%(lineno)d] - %(message)s', datefmt='%Y-%m-%d %H:%M:%S')) diff --git a/config-template.json b/config-template.json index f22efee..3af5d23 100644 --- a/config-template.json +++ b/config-template.json @@ -1,8 +1,8 @@ { "open_ai_api_key": "YOUR API KEY", - "single_chat_prefix": ["bt", "@bt"], + "single_chat_prefix": ["bot", "@bot"], "single_chat_reply_prefix": "[bot] ", - "group_chat_prefix": ["@bt"], + "group_chat_prefix": ["@bot"], "group_name_white_list": ["ChatGPT测试群", "ChatGPT测试群2"], "image_create_prefix": ["画", "看", "找"] }