From 130ef6befbc970a4432e058d75489806e776900f Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Fri, 11 Nov 2022 12:12:04 +0100 Subject: [PATCH] fixed logging to print to stdout again --- src/main.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 29a6001..316cb72 100644 --- a/src/main.py +++ b/src/main.py @@ -34,8 +34,15 @@ 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)) +# configure logger default +logging.basicConfig( + level=logging.INFO, + format="%(asctime)s [%(levelname)s] %(message)s", + handlers=[ + logging.FileHandler(os.path.join(temp_dir, LOG_FILE)), + logging.StreamHandler() + ] +) database = Database(os.path.join(temp_dir, DATABASE_FILE), os.path.join(temp_dir, DATABASE_STRUCTURE_FILE),