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")