From 0fc3c4a5737d772fc3142b3e60c72e0efecb5f49 Mon Sep 17 00:00:00 2001 From: marko-kraemer Date: Thu, 24 Apr 2025 16:54:18 +0100 Subject: [PATCH] print --- backend/agentpress/response_processor.py | 8 ++++---- backend/utils/logger.py | 9 +-------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/backend/agentpress/response_processor.py b/backend/agentpress/response_processor.py index 5de2c55b..7f8826f5 100644 --- a/backend/agentpress/response_processor.py +++ b/backend/agentpress/response_processor.py @@ -158,16 +158,16 @@ class ResponseProcessor: # Check for and log Anthropic thinking content if delta and hasattr(delta, 'reasoning_content') and delta.reasoning_content: if not has_printed_thinking_prefix: - print("[THINKING]: ", end='', flush=True) + # print("[THINKING]: ", end='', flush=True) has_printed_thinking_prefix = True - print(delta.reasoning_content, end='', flush=True) + # print(delta.reasoning_content, end='', flush=True) # Append reasoning to main content to be saved in the final message accumulated_content += delta.reasoning_content # Process content chunk if delta and hasattr(delta, 'content') and delta.content: chunk_content = delta.content - print(chunk_content, end='', flush=True) + # print(chunk_content, end='', flush=True) accumulated_content += chunk_content current_xml_content += chunk_content @@ -286,7 +286,7 @@ class ResponseProcessor: logger.info("Stopping stream processing after loop due to XML tool call limit") break - print() # Add a final newline after the streaming loop finishes + # print() # Add a final newline after the streaming loop finishes # --- After Streaming Loop --- diff --git a/backend/utils/logger.py b/backend/utils/logger.py index b07f9443..16c3a1f9 100644 --- a/backend/utils/logger.py +++ b/backend/utils/logger.py @@ -66,12 +66,6 @@ def setup_logger(name: str = 'agentpress') -> logging.Logger: logging.Logger: Configured logger instance """ logger = logging.getLogger(name) - - # Set console logging level based on environment - if config.ENV_MODE == EnvMode.PRODUCTION: - logger.setLevel(logging.WARNING) - else: - logger.setLevel(logging.INFO) # Create logs directory if it doesn't exist log_dir = 'logs' @@ -91,9 +85,8 @@ def setup_logger(name: str = 'agentpress') -> logging.Logger: # Console handler console_handler = logging.StreamHandler(sys.stdout) - # Set console logging level based on environment if config.ENV_MODE == EnvMode.PRODUCTION: - console_handler.setLevel(logging.INFO) + console_handler.setLevel(logging.WARNING) else: console_handler.setLevel(logging.DEBUG)