From b50ab81cedccdca8e637ebfc9c18dd5e10674a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=AE=AE=E0=AE=A9=E0=AF=8B=E0=AE=9C=E0=AF=8D=E0=AE=95?= =?UTF-8?q?=E0=AF=81=E0=AE=AE=E0=AE=BE=E0=AE=B0=E0=AF=8D=20=E0=AE=AA?= =?UTF-8?q?=E0=AE=B4=E0=AE=A9=E0=AE=BF=E0=AE=9A=E0=AF=8D=E0=AE=9A=E0=AE=BE?= =?UTF-8?q?=E0=AE=AE=E0=AE=BF?= Date: Wed, 29 Jan 2025 04:45:44 +0530 Subject: [PATCH] Add Verbose Debug --- openhands/core/logger.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openhands/core/logger.py b/openhands/core/logger.py index 59b8cba56b9c..09f44189c449 100644 --- a/openhands/core/logger.py +++ b/openhands/core/logger.py @@ -15,8 +15,8 @@ from termcolor import colored LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO').upper() -DEBUG = os.getenv('DEBUG', 'False').lower() in ['true', '1', 'yes'] -DEBUG_LLM = os.getenv('DEBUG_LLM', 'False').lower() in ['true', '1', 'yes'] +DEBUG = os.getenv('DEBUG', '').lower() in ['true', '1'] +DEBUG_LLM = os.getenv('DEBUG_LLM', '').lower() in ['true', '1'] # Configure litellm logging based on DEBUG_LLM if DEBUG_LLM: @@ -81,7 +81,8 @@ def __init__(self, logger: logging.Logger): def filter(self, record): if record.levelno >= logging.ERROR: - record.stack_info = self.logger.findCaller(True, 2)[-1] + if os.getenv('DEBUG') == '2': + record.stack_info = self.logger.findCaller(True, 2)[-1] record.exc_info = sys.exc_info() return True