mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-21 06:07:13 +08:00
Merge pull request #1445 from befantasy/patch-3
Update godcmd.py 增加debug模式的关闭
This commit is contained in:
@@ -4,6 +4,7 @@ import json
|
|||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
import logging
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
|
|
||||||
import bridge.bridge
|
import bridge.bridge
|
||||||
@@ -342,8 +343,12 @@ class Godcmd(Plugin):
|
|||||||
else:
|
else:
|
||||||
ok, result = False, "当前对话机器人不支持重置会话"
|
ok, result = False, "当前对话机器人不支持重置会话"
|
||||||
elif cmd == "debug":
|
elif cmd == "debug":
|
||||||
logger.setLevel("DEBUG")
|
if logger.getEffectiveLevel() == logging.DEBUG: # 判断当前日志模式是否DEBUG
|
||||||
ok, result = True, "DEBUG模式已开启"
|
logger.setLevel(logging.INFO)
|
||||||
|
ok, result = True, "DEBUG模式已关闭"
|
||||||
|
else:
|
||||||
|
logger.setLevel(logging.DEBUG)
|
||||||
|
ok, result = True, "DEBUG模式已开启"
|
||||||
elif cmd == "plist":
|
elif cmd == "plist":
|
||||||
plugins = PluginManager().list_plugins()
|
plugins = PluginManager().list_plugins()
|
||||||
ok = True
|
ok = True
|
||||||
|
|||||||
Reference in New Issue
Block a user