Add Kotlin snippet for DebugLoggingPlugin - #2105
Open
happyhuman wants to merge 3 commits into
Open
Conversation
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
happyhuman
force-pushed
the
docs-kotlin-debug-logging-plugin
branch
from
August 10, 2026 19:27
4194297 to
c9dd186
Compare
The Kotlin logging page covered LoggingPlugin's console output but not DebugLoggingPlugin, available since adk-kotlin 0.6.0, which records the same activity in full to a YAML file instead of truncated console summaries. Both plugins override the same twelve callbacks, so the difference really is only fidelity and destination. Transcluded from the existing LoggingExamples.kt rather than written inline, matching the rest of the page and keeping it in the compile regression suite -- the file is already registered in files_to_test.txt. The sample passes includeSystemInstruction = false, since the plugin's KDoc cautions that it writes raw prompts, tool arguments and session state to disk. Verified against the upstream test that the flag records has_system_instruction in place of the instruction text rather than dropping the field, and the comment names that field so it can be found in the output. outputPath is left at its default rather than passed explicitly; the default filename is given in the prose instead, so the snippet does not imply the parameter is required. Page badge left at Kotlin v0.1.0: the other snippets on the page have worked since then, so the version requirement for this one is noted in the prose.
happyhuman
force-pushed
the
docs-kotlin-debug-logging-plugin
branch
from
August 10, 2026 19:37
c9dd186 to
91494be
Compare
wikaaaaa
approved these changes
Aug 11, 2026
| ``` | ||
|
|
||
| #### Full debug capture to a file | ||
|
|
Collaborator
There was a problem hiding this comment.
use a tag under the header for language version support instead of the parenthetical comment "(adk-kotlin 0.6.0 and later)":
<div class="language-support-tag">
<span class="lst-supported">Supported in ADK</span><span class="lst-kotlin">Kotlin v0.6.0</span>
</div>
|
|
||
| #### Full debug capture to a file | ||
|
|
||
| To record the same activity in full, as YAML appended to `adk_debug.yaml` rather than truncated console output, use the `DebugLoggingPlugin` (adk-kotlin 0.6.0 and later): |
Collaborator
There was a problem hiding this comment.
remove "(adk-kotlin 0.6.0 and later)" and add language tag instead
joefernandez
approved these changes
Aug 17, 2026
joefernandez
left a comment
Collaborator
There was a problem hiding this comment.
Approved with comment:
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.
Summary
The Kotlin section of
docs/observability/logging.mdcoveredLoggingPlugin'sconsole output but not
DebugLoggingPlugin, available since adk-kotlin0.6.0, which records the same activity in full to a YAML file instead of
truncated console summaries.
11 added lines in each file, matching the shape of the
LoggingPluginsubsection directly above it.
Notes for reviewers
LoggingExamples.ktis already registered infiles_to_test.txt, so unlike an inline snippet this one is genuinelycompiled and linted by
kotlin-snippets-pr-check.yaml— both steps ran onthis PR rather than being skipped.
includeSystemInstruction = false. The plugin's KDoccautions that it writes raw prompts, tool arguments and session state to
disk. I checked the upstream test
(
DebugLoggingPluginTest.includeSystemInstructionFalse_marksPresenceWithoutLeakingText)to confirm the flag substitutes
has_system_instructionfor the text ratherthan dropping the field. Defaulting the sample to the safer value seemed
better than showing the permissive default.
outputPathleft at its default rather than passed explicitly, so thesnippet doesn't imply the parameter is required. The default filename
(
adk_debug.yaml) is given in the prose instead.logging_plugin.pyanddebug_logging_plugin.py, but this page documents plugins only in the Kotlinsection. The asymmetry predates this PR (
LoggingPluginwas alreadyKotlin-only here) but this widens it — filed as logging.md documents plugins only for Kotlin, though Python ships the same ones #2106.
Kotlin v0.1.0. The page's other Kotlin snippets workfrom 0.1.0, so bumping it would imply a floor that doesn't apply to them; the
0.6.0 requirement is stated in the prose instead.
DebugLoggingPluginis incommonJvmAndroidMain, so it works on Android too— no platform caveat needed.
Verification
.kt.verify_snippets.py: L0/L1/L2/L3/L5/L6 pass.v0.7.0sources and its test.Staged: