This commit is contained in:
Hellow2
2023-04-05 09:35:52 +02:00
parent 726da7fbe0
commit c1fb6df3b5
16 changed files with 341 additions and 419 deletions

View File

@@ -35,16 +35,17 @@ def get_random_message() -> str:
return random.choice(HAPPY_MESSAGES)
LOG_FILE = "download_logs.log"
TEMP_DIR = Path(tempfile.gettempdir(), "music-downloader")
TEMP_DIR.mkdir(exist_ok=True)
LOG_PATH = Path(TEMP_DIR, "download_logs.log")
# configure logger default
logging.basicConfig(
level=logging.INFO,
format=logging.BASIC_FORMAT,
handlers=[
logging.FileHandler(os.path.join(TEMP_DIR, LOG_FILE)),
logging.FileHandler(Path(TEMP_DIR, LOG_PATH)),
logging.StreamHandler()
]
)