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 <hangfei@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/2600 from ammmr:ammmr-info-to-debug-connect-log 36eab157f5d5ca00b44ee6ad8a4e1aeec871600c
PiperOrigin-RevId: 829596092
This commit is contained in:
GenkiNoguchi
2025-11-07 15:19:36 -08:00
committed by Copybara-Service
parent 34ea2edfd2
commit 42d4c4ed5f
+2 -1
View File
@@ -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: