Skip to content

ref: route all SDK diagnostics through debugLogger - #2631

Open
Abhijeet Prasad (AbhiPrasad) wants to merge 2 commits into
mainfrom
refactor/sdk-debug-logger
Open

Abhijeet Prasad (AbhiPrasad) wants to merge 2 commits into
mainfrom
refactor/sdk-debug-logger

Conversation

@AbhiPrasad

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Was looking at adding console.log instrumentation and figured we need to do this first. But open to other ideas.

Routes the SDK's remaining console.* diagnostics through debugLogger. Adds debugLogger.notice for user-facing messages that should stay visible by default.

debugLogger.warn("...");         // hidden unless a level is configured
debugLogger.notice.warn("...");  // shown by default
level configured?
  ├─ false      → silent
  ├─ "<level>"  → filter by level (applies to notice too)
  └─ unset      → notice.* prints as "warn", everything else silent
Method Used for
notice.* wrapper "Not wrapping" warnings, late configureInstrumentation, span customizer failure, dev server errors, publish() warnings, scorer/vitest warnings, auto-instrumentation transform failures
warn / error / debug internal swallowed errors (stream patcher, plugins, telemetry, disk cache), auto-instrumentation status

Behavior changes

Before After
Internal handler errors always printed Opt-in via BRAINTRUST_DEBUG_LOG_LEVEL / debugLogLevel
DEBUG='@braintrust*' showed auto-instrumentation status BRAINTRUST_DEBUG_LOG_LEVEL=debug
[braintrust] [Braintrust] ... Duplicate prefixes removed

🤖 Generated with Claude Code

Notice warnings and errors print at warn when no debug log level is
configured, respect an explicit level, and are silenced by
debugLogLevel: false. Use it for diagnostics that were always shown
before routing through debugLogger, only mark the span customizer
failure as logged once it is emitted, and drop duplicate Braintrust
prefixes from logger messages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T17:24:33.903558Z 2aed613 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) changed the title refactor: route SDK diagnostics through debugLogger ref: route all SDK diagnostics through debugLogger Oct 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant