From dd4c0b2b751ee6f7cbb9837796635dd4093720ad Mon Sep 17 00:00:00 2001 From: Floke Date: Sat, 19 Apr 2025 07:15:24 +0000 Subject: [PATCH] bugfix --- brancheneinstufung.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/brancheneinstufung.py b/brancheneinstufung.py index 2229a3a5..16533f2f 100644 --- a/brancheneinstufung.py +++ b/brancheneinstufung.py @@ -3981,6 +3981,22 @@ class DataProcessor: # ==================== MAIN FUNCTION ==================== def main(): global LOG_FILE + import logging +# Ganz am Anfang von main, vor dem ersten debug_print +log_level = logging.DEBUG # Explizit setzen +logging.basicConfig(level=log_level, + format='%(asctime)s - %(levelname)s - %(name)s - %(message)s', # Name des Loggers hinzufügen + filename=LOG_FILE, # In Datei schreiben + filemode='a') # Anfügen +# Optional: Auch auf Konsole ausgeben +console_handler = logging.StreamHandler() +console_handler.setLevel(log_level) +console_handler.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %(name)s - %(message)s')) +logging.getLogger('').addHandler(console_handler) + +# Testnachricht nach Logging-Setup +logging.debug("DEBUG Logging ist konfiguriert.") +logging.info("INFO Logging ist konfiguriert.") # --- Initialisierung --- parser = argparse.ArgumentParser(description="Firmen-Datenanreicherungs-Skript")