Browse Source

Update godcmd.py 增加debug模式的关闭

master
befantasy GitHub 1 year ago
parent
commit
5010c76ef7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      plugins/godcmd/godcmd.py

+ 7
- 2
plugins/godcmd/godcmd.py View File

@@ -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 plugins import plugins
@@ -339,8 +340,12 @@ class Godcmd(Plugin):
else: else:
ok, result = False, "当前对话机器人不支持重置会话" ok, result = False, "当前对话机器人不支持重置会话"
elif cmd == "debug": elif cmd == "debug":
logger.setLevel("DEBUG")
ok, result = True, "DEBUG模式已开启"
if logger.getEffectiveLevel() == logging.DEBUG: # 判断当前日志模式是否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


Loading…
Cancel
Save