Commit 42d4c4e
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: 8295960921 parent 34ea2ed commit 42d4c4e
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
| 285 | + | |
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
| |||
0 commit comments