Skip to content

Commit 8a2199f

Browse files
committed
prevent logger from raise exception
1 parent 92cd591 commit 8a2199f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

eval_protocol/log_utils/init.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,20 @@ def init_external_logging_from_env() -> None:
2929
Environment variables:
3030
- FW_TRACING_GATEWAY_BASE_URL: enable Fireworks tracing handler when set
3131
- EP_ELASTICSEARCH_URL, EP_ELASTICSEARCH_API_KEY, EP_ELASTICSEARCH_INDEX: enable ES when all set
32+
- EP_LOGGING_RAISE_EXCEPTIONS: if set to "false" or "0", disable logging exceptions (default: True)
3233
"""
3334
global _INITIALIZED
3435
if _INITIALIZED:
3536
return
3637

38+
# Configure logging.raiseExceptions based on environment variable
39+
# If set to "false" or "0", logging errors will be silently ignored
40+
raise_exceptions_env = _get_env("EP_LOGGING_RAISE_EXCEPTIONS")
41+
if raise_exceptions_env is not None:
42+
logging.raiseExceptions = raise_exceptions_env.lower() in ("true", "1", "no")
43+
else:
44+
logging.raiseExceptions = False
45+
3746
root_logger = logging.getLogger()
3847

3948
# Ensure we do not add duplicate handlers if already present

0 commit comments

Comments
 (0)