Skip to content

fix(api-logs)!: minimize noop logger exports#6713

Merged
trentm merged 2 commits into
open-telemetry:mainfrom
dynatrace-oss-contrib:fix/api-logs-minimize-noop-exports
May 15, 2026
Merged

fix(api-logs)!: minimize noop logger exports#6713
trentm merged 2 commits into
open-telemetry:mainfrom
dynatrace-oss-contrib:fix/api-logs-minimize-noop-exports

Conversation

@dyladan

@dyladan dyladan commented May 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Replaces the exported NOOP_LOGGER constant and NoopLogger class with a single createNoopLogger(): Logger function, following the same pattern as the metrics API's createNoopMeter()
  • The return type is narrowed to Logger to guarantee only the minimum required interface
  • Updates sdk-logs LoggerProvider to use createNoopLogger() instead of NOOP_LOGGER
  • Updates tests that relied on instanceof NoopLogger to use behavioral checks instead

Test plan

  • api-logs tests pass
  • sdk-logs tests pass

Fixes #6681

🤖 Generated with Claude Code

@dyladan
dyladan requested review from a team as code owners May 13, 2026 19:16
@linux-foundation-easycla

linux-foundation-easycla Bot commented May 13, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: dyladan / name: Daniel Dyla (6f3733b)

Replace the exported `NOOP_LOGGER` constant and `NoopLogger` class with
a single `createNoopLogger(): Logger` function, following the same pattern
as the metrics API's `createNoopMeter()`. The return type is narrowed to
`Logger` to guarantee only the minimum required interface.

Fixes open-telemetry#6681
@dyladan
dyladan force-pushed the fix/api-logs-minimize-noop-exports branch from 81f37cb to 6f3733b Compare May 13, 2026 19:17
@codecov

codecov Bot commented May 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.83%. Comparing base (67c1e89) to head (6ae2530).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
experimental/packages/api-logs/src/NoopLogger.ts 50.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (75.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6713      +/-   ##
==========================================
- Coverage   94.84%   94.83%   -0.01%     
==========================================
  Files         376      376              
  Lines       12702    12704       +2     
  Branches     2885     2885              
==========================================
+ Hits        12047    12048       +1     
- Misses        655      656       +1     
Files with missing lines Coverage Δ
...perimental/packages/sdk-logs/src/LoggerProvider.ts 100.00% <100.00%> (ø)
experimental/packages/api-logs/src/NoopLogger.ts 85.71% <50.00%> (-14.29%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@trentm trentm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Put ! for breaking in the PR title?

@dyladan dyladan changed the title fix(api-logs): minimize noop logger exports fix!(api-logs): minimize noop logger exports May 15, 2026
@dyladan

dyladan commented May 15, 2026

Copy link
Copy Markdown
Member Author

nit: Put ! for breaking in the PR title?

done

@trentm trentm changed the title fix!(api-logs): minimize noop logger exports fix(api-logs)!: minimize noop logger exports May 15, 2026
@trentm
trentm added this pull request to the merge queue May 15, 2026
Merged via the queue into open-telemetry:main with commit 6d5f93e May 15, 2026
28 of 29 checks passed
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.

[api-logs] ensure noop logger exports are minimal

3 participants