修复了在heroku的python无法主动创建文件夹而导致错误的bug

This commit is contained in:
MarkusJoe
2022-02-16 13:26:41 +08:00
parent 05fe61b1fc
commit ab8d3682c2
3 files changed
+3 -3

No files matched your search

View File
Whitespace-only changes.
+2 -2
View File
@@ -134,8 +134,8 @@ def single_download(url):
if __name__ != '__main__':
if not os.path.exists('./log'):
os.mkdir('./log')
if not os.path.exists('./bin/log'):
os.mkdir('./bin/log')
if not os.path.exists('./bin/assets/theme.db'):
logger.error('没有检测到本地主题数据库即将开始下载')
Check().download()
+1 -1
View File
@@ -36,7 +36,7 @@ class Logger:
ConsoleLogger = logging.StreamHandler() # 输出到终端
ConsoleLogger.setFormatter(formatter)
log_name = time.strftime('%Y-%m-%d %H') # 一小时内使用的日志文件都是同一个
FileLogger = logging.handlers.RotatingFileHandler(filename=f'./log/{log_name}.log',
FileLogger = logging.handlers.RotatingFileHandler(filename=f'./bin/log/{log_name}.log',
maxBytes=102400,
backupCount=5) # 每个日志文件最大102400字节(100Kb)
FileLogger.setFormatter(formatter_file)