docs: add logger & scoped context (AsyncLocalStorage) guide#3079
docs: add logger & scoped context (AsyncLocalStorage) guide#3079amikofalvy wants to merge 1 commit intomainfrom
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Document the AsyncLocalStorage-based scoped logger pattern introduced in recent commits — imports, usage patterns, how it works, and rules. https://claude.ai/code/session_01CCdgr1tjNzD9ZWj11zj8Qb
0796d00 to
2f72754
Compare
|
TL;DR — Adds a comprehensive "Logger & Scoped Context" section to Key changes
Summary | 1 file | 1 commit | base:
The new section sits between "Environment Configuration" and "Isolated Parallel Environments," giving it a natural place in the implementation details flow. It references the
|
There was a problem hiding this comment.
Clean, accurate documentation. All claims verified against the source code — PinoLogger, getLogger(), runWithLogContext(), .with() snapshot semantics, and AsyncLocalStorage usage all match the actual implementation in packages/agents-core/src/utils/logger.ts and related files. The section is well-placed, complements the existing api-logging-guidelines skill without overlap, and follows the established AGENTS.md structure.
Claude Opus | 𝕏
There was a problem hiding this comment.
PR Review Summary
(0) Total Issues | Risk: Low
Summary
This PR adds comprehensive documentation for the logger & scoped context system to AGENTS.md. The documentation:
- ✅ Accurately describes the actual implementation in
packages/agents-core/src/utils/logger.ts - ✅ Correctly references all key files (
logger.ts,createApp.tsmiddleware) - ✅ Provides clear usage patterns with three well-documented approaches (module-level, class member with
.with(), operation-level scoping) - ✅ Includes actionable rules that will help AI agents and contributors use the logger correctly
- ✅ Cross-references the
api-logging-guidelinesskill appropriately for log level guidance
The section is well-placed between "Environment Configuration" and "Isolated Parallel Environments" in the AGENTS.md structure, following the established documentation patterns.
✅ APPROVE
Summary: Clean, accurate documentation that fills an important gap. All claims verified against source code — PinoLogger, getLogger(), runWithLogContext(), .with() snapshot semantics, and AsyncLocalStorage usage all match the actual implementation. The section complements the existing api-logging-guidelines skill without overlap. Ship it! 🚀
Reviewers (3)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
pr-review-docs |
0 | 0 | 0 | 0 | 0 | 0 | 0 |
pr-review-devops |
0 | 0 | 0 | 0 | 0 | 0 | 0 |
pr-review-standards |
0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Total | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Preview URLsUse these stable preview aliases for testing this PR:
These point to the same Vercel preview deployment as the bot comment, but they stay stable and easier to find. Raw Vercel deployment URLs
|
|
This pull request has been automatically marked as stale because it has not had recent activity. If this PR is still relevant:
Thank you for your contributions! |

Summary
Added comprehensive documentation for the scoped context logger implementation built on Pino + AsyncLocalStorage in the AGENTS.md file.
Changes
AGENTS.mdexplaining the logger & scoped context system:@inkeep/agents-coreandagents-api.with()for snapshot semanticsrunWithLogContext()Details
This documentation guide helps developers understand:
getLogger()vsrunWithLogContext().with()https://claude.ai/code/session_01CCdgr1tjNzD9ZWj11zj8Qb