Skip to content

Commit

Permalink
Add Verbose Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Jan 28, 2025
1 parent 16597fe commit b50ab81
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions openhands/core/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b50ab81

Please sign in to comment.