bugfix
This commit is contained in:
@@ -11180,16 +11180,13 @@ def main():
|
||||
"""
|
||||
# WICHTIG: Globale Variable LOG_FILE wird benoetigt (Initialisierung Block 3)
|
||||
global LOG_FILE
|
||||
logger = logging.getLogger(__name__) # <<< JETZT AN DER RICHTIGEN STELLE
|
||||
|
||||
# --- Initial Logging Setup (Konfiguration von Level und Format) ---
|
||||
# Diese Konfiguration wird wirksam, sobald die Handler hinzugefuegt werden.
|
||||
# Standard-Logging Level festlegen (aus Config Block 1)
|
||||
log_level = logging.DEBUG if getattr(Config, 'DEBUG', False) else logging.INFO
|
||||
log_format = '%(asctime)s - %(levelname)-8s - %(name)-25s - %(message)s' # Angepasstes Format mit breiterem Namen
|
||||
|
||||
# Root-Logger konfigurieren (mit Console Handler, File Handler wird spaeter hinzugefuegt)
|
||||
# handlers=[] verhindert default Console Handler, wir fuegen ihn manuell hinzu fuer mehr Kontrolle
|
||||
logging.basicConfig(level=log_level, format=log_format, handlers=[])
|
||||
# ... (Rest des Logging Setups bleibt gleich) ...
|
||||
|
||||
# Console Handler explizit hinzufuegen
|
||||
console_handler = logging.StreamHandler()
|
||||
@@ -11201,7 +11198,7 @@ def main():
|
||||
|
||||
|
||||
# Testnachricht (geht nur an Konsole, da File Handler noch fehlt)
|
||||
logger.debug("DEBUG Logging initial konfiguriert (nur Konsole).")
|
||||
logger.debug("DEBUG Logging initial konfiguriert (nur Konsole).") # Jetzt sollte logger definiert sein
|
||||
logger.info("INFO Logging initial konfiguriert (nur Konsole).")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user