Skip to content

fix(component-sdk): gate component diagnostic logs#9

Merged
zebbern merged 1 commit into
mainfrom
codex/quiet-component-progress-logs
Jun 20, 2026
Merged

fix(component-sdk): gate component diagnostic logs#9
zebbern merged 1 commit into
mainfrom
codex/quiet-component-progress-logs

Conversation

@zebbern

@zebbern zebbern commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • gate component SDK progress console mirroring behind SENTRIS_DEBUG_COMPONENTS=1
  • gate logger info/debug console mirroring behind the same flag
  • keep structured trace/log collector behavior and warning/error console output unchanged

Verification

  • bun test packages/component-sdk/src/tests/context.test.ts
  • bun test packages/component-sdk
  • git diff --check
  • bun run typecheck
  • bun run lint
  • bun run test

Signed-off-by: zebbern <185730623+zebbern@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 16:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces noisy component diagnostic output by gating console mirroring for component SDK progress events and logger info/debug output behind SENTRIS_DEBUG_COMPONENTS=1, while keeping structured trace/log collection and warn/error console behavior unchanged.

Changes:

  • Add shouldMirrorComponentDiagnostics() and guard console.log/console.debug mirroring for progress + info/debug logs.
  • Preserve warn/error console mirroring behavior.
  • Add tests asserting progress + info/debug are not mirrored to the console by default.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/component-sdk/src/context.ts Gates console mirroring for progress + info/debug behind SENTRIS_DEBUG_COMPONENTS=1.
packages/component-sdk/src/tests/context.test.ts Adds coverage to ensure default behavior does not mirror to console for progress + info/debug.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 193 to +197
timestamp: new Date().toISOString(),
metadata,
});
console.debug(`[${componentRef}]`, ...args);
if (shouldMirrorComponentDiagnostics()) {
console.debug(`[${componentRef}]`, ...args);
Comment on lines 207 to +211
timestamp: new Date().toISOString(),
metadata,
});
console.log(`[${componentRef}]`, ...args);
if (shouldMirrorComponentDiagnostics()) {
console.log(`[${componentRef}]`, ...args);
@zebbern zebbern merged commit aa4500b into main Jun 20, 2026
6 checks passed
@zebbern zebbern deleted the codex/quiet-component-progress-logs branch June 20, 2026 16:25
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.

2 participants