From e3e3d3b91482550814938afd8d64d3cda40ae377 Mon Sep 17 00:00:00 2001 From: z060142 Date: Fri, 16 May 2025 02:26:28 +0800 Subject: [PATCH] Fix duplicate log print issue --- .gitignore | 1 + Setup.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 694f3f6..dc8f9d5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ llm_debug.log config.py config.py.bak +simple_bubble_dedup.json __pycache__/ debug_screenshots/ chat_logs/ diff --git a/Setup.py b/Setup.py index 9d711c3..520d02d 100644 --- a/Setup.py +++ b/Setup.py @@ -69,6 +69,7 @@ keep_monitoring_flag.set() # logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') # Setup logger instance. This can be configured further if needed. logger = logging.getLogger(__name__) +logger.propagate = False if not logger.handlers: # Avoid adding multiple handlers if script is reloaded handler = logging.StreamHandler() formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') @@ -2783,8 +2784,8 @@ else: # HAS_SOCKETIO is False # =============================================================== if __name__ == "__main__": # Setup main logger for the application if not already done - if not logging.getLogger().handlers: # Check root logger - logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') + #if not logging.getLogger().handlers: # Check root logger + # logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') app = WolfChatSetup() app.protocol("WM_DELETE_WINDOW", app.on_closing) # Handle window close button