Skip to content

Commit

Permalink
fix: log config bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhayujie committed Apr 11, 2023
1 parent 9831b10 commit fc1c962
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
8 changes: 1 addition & 7 deletions common/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
4 changes: 0 additions & 4 deletions config-template.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"logger": {
"switch": true,
"level": "INFO"
},
"model": {
"type" : "chatgpt",
"openai": {
Expand Down

0 comments on commit fc1c962

Please sign in to comment.