From ab8d3682c2fc6d2cccca3d7d7191f98dbde7ee68 Mon Sep 17 00:00:00 2001 From: MarkusJoe Date: Wed, 16 Feb 2022 13:26:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E5=9C=A8heroku?= =?UTF-8?q?=E7=9A=84python=E6=97=A0=E6=B3=95=E4=B8=BB=E5=8A=A8=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=96=87=E4=BB=B6=E5=A4=B9=E8=80=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {log => bin/log}/.gitkeep | 0 bin/utils/__init__.py | 4 ++-- bin/utils/logger.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename {log => bin/log}/.gitkeep (100%) diff --git a/log/.gitkeep b/bin/log/.gitkeep similarity index 100% rename from log/.gitkeep rename to bin/log/.gitkeep diff --git a/bin/utils/__init__.py b/bin/utils/__init__.py index 75feb1f..e9f6b33 100644 --- a/bin/utils/__init__.py +++ b/bin/utils/__init__.py @@ -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() diff --git a/bin/utils/logger.py b/bin/utils/logger.py index 1443dbb..6e605d4 100644 --- a/bin/utils/logger.py +++ b/bin/utils/logger.py @@ -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)