Repository navigation
Conversation
Collaborator
|
Hello @ivanmkc, thank you for your contribution! To help us review this PR, please address the following points from our contribution guidelines:
You can find more details in our contribution guidelines. Response from ADK Triaging Agent |
This commit introduces the `LogCollectorPlugin`, a plugin that collects execution logs from ADK callbacks in asynchronous environments. Logs are organized by session ID for retrieval. The plugin uses `asyncio.Lock` to ensure thread-safe logging. Logs are stored in a `defaultdict(list)` indexed by session ID and can be retrieved with the `get_logs_by_session` method. The plugin implements the following callback hooks to log contextual data: - `on_user_message` - `before_run`, `after_run` - `before_agent`, `after_agent` - `before_model`, `after_model`, `on_model_error` - `before_tool`, `after_tool`, `on_tool_error` - `on_event` Each log entry includes the callback type and relevant data, such as invocation ID, agent name, tool name, function call ID, arguments, and results or errors.
ivanmkc
force-pushed
the
imkc--tool_log_collector_plugin.py
branch
from
August 8, 2025 22:41
ffb7094 to
4696b68
Compare
Collaborator
|
It's supported now through: https://github.com/google/adk-python/blob/main/src/google/adk/plugins/logging_plugin.py. Closing this. If this doesn't work for you, feel free to raise a issue or PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces the
LogCollectorPlugin, a plugin that collects execution logs from ADK callbacks in asynchronous environments. Logs are organized by session ID for retrieval.The plugin uses
asyncio.Lockto ensure thread-safe logging. Logs are stored in adefaultdict(list)indexed by session ID and can be retrieved with theget_logs_by_sessionmethod.The plugin implements the following callback hooks to log contextual data:
on_user_messagebefore_run,after_runbefore_agent,after_agentbefore_model,after_model,on_model_errorbefore_tool,after_tool,on_tool_erroron_eventEach log entry includes the callback type and relevant data, such as invocation ID, agent name, tool name, function call ID, arguments, and results or errors.