Skip to content

Comments

Add Logger::logRecordBuilder()#1859

Merged
brettmc merged 6 commits intoopen-telemetry:mainfrom
Nevay:feature/logger-logrecordbuilder
Jan 21, 2026
Merged

Add Logger::logRecordBuilder()#1859
brettmc merged 6 commits intoopen-telemetry:mainfrom
Nevay:feature/logger-logrecordbuilder

Conversation

@Nevay
Copy link
Contributor

@Nevay Nevay commented Jan 19, 2026

  • allows applying log limits earlier
  • allows returning a noop-implementation for noop/disabled loggers

A longterm goal is to break up the broken LogRecord->ReadableLogRecord->ReadWriteLogRecord hierarchy.

  • ReadWriteLogRecord ::setAttribute()/::setAttributes() (c529fbf) and ::setContext() do not work
  • ReadableLogRecord exposes mutators

@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 23.61111% with 55 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.04%. Comparing base (13636b3) to head (40689ec).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/SDK/Logs/LogRecordBuilder.php 29.26% 29 Missing ⚠️
src/API/Logs/NoopLogRecordBuilder.php 0.00% 21 Missing ⚠️
src/API/Logs/NoopLogger.php 0.00% 3 Missing ⚠️
src/API/Logs/LateBindingLogger.php 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1859      +/-   ##
============================================
- Coverage     68.38%   68.04%   -0.35%     
- Complexity     2978     3012      +34     
============================================
  Files           450      453       +3     
  Lines          8731     8819      +88     
============================================
+ Hits           5971     6001      +30     
- Misses         2760     2818      +58     
Flag Coverage Δ
8.2 68.03% <23.61%> (-0.21%) ⬇️
8.3 68.03% <23.61%> (-0.23%) ⬇️
8.4 67.93% <23.61%> (-0.36%) ⬇️
8.5 67.12% <23.61%> (-0.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/API/Logs/LogRecord.php 89.65% <ø> (ø)
src/SDK/Logs/Logger.php 90.47% <100.00%> (+2.24%) ⬆️
src/API/Logs/LateBindingLogger.php 42.85% <0.00%> (-17.15%) ⬇️
src/API/Logs/NoopLogger.php 62.50% <0.00%> (-37.50%) ⬇️
src/API/Logs/NoopLogRecordBuilder.php 0.00% <0.00%> (ø)
src/SDK/Logs/LogRecordBuilder.php 29.26% <29.26%> (ø)

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13636b3...40689ec. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Nevay Nevay marked this pull request as ready for review January 20, 2026 12:35
@Nevay Nevay requested a review from a team as a code owner January 20, 2026 12:35
@brettmc brettmc merged commit 7de6875 into open-telemetry:main Jan 21, 2026
7 of 9 checks passed
@brettmc
Copy link
Contributor

brettmc commented Jan 21, 2026

@Nevay I plan to release API 1.8.0 with these changes, have you anything in progress that I should wait on?

@Nevay
Copy link
Contributor Author

Nevay commented Jan 21, 2026

@brettmc I have nothing planned in the immediate future. We'll also need to tag SDK 1.12.0.

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