Skip to content

Commit

Permalink
Fix bug: "Logs" folder can't created when not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
aicorein authored Mar 19, 2023
1 parent 3f7c84c commit 386b531
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions utils/botLogger.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging.handlers
import logging.config
import logging
import os
from logging import DEBUG, INFO, WARN, WARNING, ERROR, CRITICAL
from .globalPattern import *
from .globalData import BOT_STORE
Expand Down Expand Up @@ -74,6 +75,12 @@
},
}

# 不存在 logs 文件夹就新建
logs_folder_path = os.path.join(
os.path.dirname(__file__), '..', 'logs'
)
if not os.path.exists(logs_folder_path):
os.mkdir(logs_folder_path)

BOT_LOGGER = log_level = BOT_STORE['operation']['LOG_LEVEL']
if log_level != None and log_level != "":
Expand Down

0 comments on commit 386b531

Please sign in to comment.