Skip to content

Commit 42d4c4e

Browse files
ammmrhangfei
authored andcommitted
chore: Change live connection log level from info to debug
Merge #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=#2600 from ammmr:ammmr-info-to-debug-connect-log 36eab15 PiperOrigin-RevId: 829596092
1 parent 34ea2ed commit 42d4c4e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/google/adk/models/google_llm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ async def connect(self, llm_request: LlmRequest) -> BaseLlmConnection:
281281
],
282282
)
283283
llm_request.live_connect_config.tools = llm_request.config.tools
284-
logger.info('Connecting to live with llm_request:%s', llm_request)
284+
logger.info('Connecting to live for model: %s', llm_request.model)
285+
logger.debug('Connecting to live with llm_request:%s', llm_request)
285286
async with self._live_api_client.aio.live.connect(
286287
model=llm_request.model, config=llm_request.live_connect_config
287288
) as live_session:

0 commit comments

Comments
 (0)