fix: log config bug

This commit is contained in:
zhayujie
2023-04-11 22:24:22 +08:00
parent 9831b10346
commit fc1c96233b
2 changed files with 1 additions and 11 deletions

View File

@@ -2,18 +2,12 @@
import logging
import sys
import config
SWITCH = True
def _get_logger():
global SWITCH
config.load_config()
SWITCH = config.conf().get("logger").get("switch", True)
log = logging.getLogger('log')
level = config.conf().get("logger").get("level", logging.INFO)
log.setLevel(level)
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'))

View File

@@ -1,8 +1,4 @@
{
"logger": {
"switch": true,
"level": "INFO"
},
"model": {
"type" : "chatgpt",
"openai": {