mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
Reduce the noise from loggers (#8833)
This commit is contained in:
@@ -385,11 +385,23 @@ if LOG_TO_FILE:
|
||||
) # default log to project root
|
||||
openhands_logger.debug(f'Logging to file in: {LOG_DIR}')
|
||||
|
||||
# Exclude LiteLLM from logging output
|
||||
# Exclude LiteLLM from logging output as it can leak keys
|
||||
logging.getLogger('LiteLLM').disabled = True
|
||||
logging.getLogger('LiteLLM Router').disabled = True
|
||||
logging.getLogger('LiteLLM Proxy').disabled = True
|
||||
|
||||
# Exclude loquacious loggers
|
||||
LOQUACIOUS_LOGGERS = [
|
||||
'engineio',
|
||||
'engineio.server',
|
||||
'socketio',
|
||||
'socketio.client',
|
||||
'socketio.server',
|
||||
]
|
||||
|
||||
for logger_name in LOQUACIOUS_LOGGERS:
|
||||
logging.getLogger(logger_name).setLevel('WARNING')
|
||||
|
||||
|
||||
class LlmFileHandler(logging.FileHandler):
|
||||
"""LLM prompt and response logging."""
|
||||
|
||||
Reference in New Issue
Block a user