Create directory for logs if missing (#162)

This commit is contained in:
Nameless 2020-07-23 17:38:06 +08:00 committed by GitHub
parent bb2d9b889f
commit 7a9e31231b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -81,8 +81,7 @@ if os.path.isfile(CONFIG_FILE):
if param.isupper():
globals()[param] = value
else:
for directory in (LOG_PATH, CONFIG_DIR, FILES_DIR):
os.makedirs(directory, exist_ok=True)
os.makedirs(CONFIG_DIR, exist_ok=True)
if not PHONE:
print(

View file

@ -49,6 +49,8 @@ class LogWriter:
def setup_log() -> None:
os.makedirs(config.LOG_PATH, exist_ok=True)
handlers = []
for level, filename in (