From 42d4c4ed5ff292d54bc5382f9fb274ec98becaba Mon Sep 17 00:00:00 2001 From: GenkiNoguchi <40311508+ammmr@users.noreply.github.com> Date: Fri, 7 Nov 2025 15:19:36 -0800 Subject: [PATCH] chore: Change live connection log level from info to debug Merge https://github.com/google/adk-python/pull/2600 **Reason for this change:** Currently, the detailed llm_request object is logged at the info level when connecting to the live API. This causes two main issues: 1. Excessive log output with large instructions: When instructions are large, the unstructured log output becomes problematic. Since the logs are not structured, any newline characters in the instruction content cause each line to be output as a separate log entry, resulting in massive log output that floods the logging system. 2. Unnecessary verbosity in production: The detailed request information is primarily useful for debugging purposes and should not appear in standard info-level logs, especially when connections are established frequently. **Changes made:** - Changed logger.info to logger.debug in src/google/adk/models/google_llm.py at line 294 for the live connection logging statement. **Impact:** This change will: - Reduce log noise in production environments where info-level logging is enabled - Keep the detailed connection information available when debug-level logging is needed for troubleshooting - Improve log readability by showing only essential information at the info level **Before:** logger.info('Connecting to live with llm_request:%s', llm_request) **After:** logger.debug('Connecting to live with llm_request:%s', llm_request) This is a non-breaking change that only affects logging verbosity. Co-authored-by: Hangfei Lin COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/2600 from ammmr:ammmr-info-to-debug-connect-log 36eab157f5d5ca00b44ee6ad8a4e1aeec871600c PiperOrigin-RevId: 829596092 --- src/google/adk/models/google_llm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/google/adk/models/google_llm.py b/src/google/adk/models/google_llm.py index 84f8cf51..a95fb5db 100644 --- a/src/google/adk/models/google_llm.py +++ b/src/google/adk/models/google_llm.py @@ -281,7 +281,8 @@ class Gemini(BaseLlm): ], ) llm_request.live_connect_config.tools = llm_request.config.tools - logger.info('Connecting to live with llm_request:%s', llm_request) + logger.info('Connecting to live for model: %s', llm_request.model) + logger.debug('Connecting to live with llm_request:%s', llm_request) async with self._live_api_client.aio.live.connect( model=llm_request.model, config=llm_request.live_connect_config ) as live_session: