Repository navigation
feat(core): export the logger facade from the @google/adk public API - #944
Merged
Merged
Conversation
added 3 commits
September 24, 2026 14:16
getLogger() returns a snapshot, so a consumer who caches it in a module-level const never sees a later setLogger(). The logger facade resolves the installed instance on every call, but it was only reachable from inside the package. Export it, and document the lifetime rule on both symbols.
Pin the late-binding guarantee through '@google/adk', including the contrast with a cached getLogger() result.
The getLogger comment told callers not to cache the result in a module-level const, which two in-tree call sites still do. The logger comment called the facade the recommended way to log, which is a separate decision from exporting it. Both comments now state only the lifetime behaviour.
Collaborator
|
Merging in about 6h unless someone objects. Close this PR, add |
Collaborator
|
Merging in about 1h unless someone objects. Close this PR, add |
adk-foundry-approver
approved these changes
Sep 25, 2026
adk-foundry-approver
left a comment
Collaborator
There was a problem hiding this comment.
Approved automatically by ADK Foundry. No human has read this change.
This approval attests only that the change passed the gates below, all
enforced in code:
- the merge critic read the diff and approved it (93.9% precision measured
against 107 upstream pull requests with known maintainer outcomes) - ? changed lines across ? file(s), inside the 200/5 ceiling
- no auth, credential, security, release or dependency-manifest path touched
- required checks green, re-verified immediately before this approval
- opened 25h ago and visible as
automerge: scheduledthroughout,
with no objection from anyone
To stop this merging, close the pull request or add status/on-hold. To stop
the mechanism entirely, revoke this account's access; delivery continues and
nothing merges.
Merged
prasanna8585
pushed a commit
to prasanna8585/adk-js
that referenced
this pull request
Nov 10, 2026
…oogle#944) * feat(core): export the logger facade from the public API getLogger() returns a snapshot, so a consumer who caches it in a module-level const never sees a later setLogger(). The logger facade resolves the installed instance on every call, but it was only reachable from inside the package. Export it, and document the lifetime rule on both symbols. * test(core): cover the public logger export Pin the late-binding guarantee through '@google/adk', including the contrast with a cached getLogger() result. * docs(core): trim the logger doc comments to the facts The getLogger comment told callers not to cache the result in a module-level const, which two in-tree call sites still do. The logger comment called the facade the recommended way to log, which is a separate decision from exporting it. Both comments now state only the lifetime behaviour.
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.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
2. Or, if no issue exists, describe the change:
Problem:
@google/adkexportsgetLogger(),setLogger(),setLogLevel(), andLogLevel, but it does not export theloggerfacade.getLogger()returns a snapshot, so a module-scope reference keeps writing to the logger that was installed at import time. A latersetLogger()call does not update that reference, andsetLogger(null)does not silence it. Internal modules use theloggerfacade to resolve the active logger on each call, and external consumers need that export.Solution:
Re-export the
loggerfacade fromcore/src/common.tsso both the Node and web entry points expose it. Update thegetLogger()andloggerdoc comments to document their instance lifetime behavior.Testing Plan
Unit Tests:
Manual End-to-End (E2E) Tests:
Checklist
Additional context
N/A