From 8a2199f68e30f72a10535680563bbab3cf71fb64 Mon Sep 17 00:00:00 2001 From: Yinghan Ma Date: Wed, 5 Nov 2025 19:01:28 -0800 Subject: [PATCH] prevent logger from raise exception --- eval_protocol/log_utils/init.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eval_protocol/log_utils/init.py b/eval_protocol/log_utils/init.py index 795cf7ba..b8f942fc 100644 --- a/eval_protocol/log_utils/init.py +++ b/eval_protocol/log_utils/init.py @@ -29,11 +29,20 @@ def init_external_logging_from_env() -> None: Environment variables: - FW_TRACING_GATEWAY_BASE_URL: enable Fireworks tracing handler when set - EP_ELASTICSEARCH_URL, EP_ELASTICSEARCH_API_KEY, EP_ELASTICSEARCH_INDEX: enable ES when all set + - EP_LOGGING_RAISE_EXCEPTIONS: if set to "false" or "0", disable logging exceptions (default: True) """ global _INITIALIZED if _INITIALIZED: return + # Configure logging.raiseExceptions based on environment variable + # If set to "false" or "0", logging errors will be silently ignored + raise_exceptions_env = _get_env("EP_LOGGING_RAISE_EXCEPTIONS") + if raise_exceptions_env is not None: + logging.raiseExceptions = raise_exceptions_env.lower() in ("true", "1", "no") + else: + logging.raiseExceptions = False + root_logger = logging.getLogger() # Ensure we do not add duplicate handlers if already present