From 38f0ac159766068408dc6780b410af890d638cc9 Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Wed, 9 Nov 2022 08:22:28 +0100 Subject: [PATCH] created logs --- src/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 87ab696..df97213 100644 --- a/src/main.py +++ b/src/main.py @@ -10,9 +10,9 @@ import logging import os import tempfile -logging.basicConfig(level=logging.INFO) TEMP_FOLDER = "music-downloader" +LOG_FILE = "download_logs.log" DATABASE_FILE = "metadata.db" DATABASE_STRUCTURE_FILE = "database_structure.sql" DATABASE_STRUCTURE_FALLBACK = "https://raw.githubusercontent.com/HeIIow2/music-downloader/new_metadata/assets/database_structure.sql" @@ -32,6 +32,9 @@ temp_dir = os.path.join(tempfile.gettempdir(), TEMP_FOLDER) if not os.path.exists(temp_dir): os.mkdir(temp_dir) +# configure logger basics +logging.basicConfig(level=logging.INFO, filename=os.path.join(temp_dir, LOG_FILE)) + database = Database(os.path.join(temp_dir, DATABASE_FILE), os.path.join(temp_dir, DATABASE_STRUCTURE_FILE), DATABASE_STRUCTURE_FALLBACK,