Skip to content

Comments

stabilize logger.enabled#1580

Merged
bobstrecansky merged 1 commit intoopen-telemetry:mainfrom
brettmc:stabilize-logger-enabled
May 7, 2025
Merged

stabilize logger.enabled#1580
bobstrecansky merged 1 commit intoopen-telemetry:mainfrom
brettmc:stabilize-logger-enabled

Conversation

@brettmc
Copy link
Contributor

@brettmc brettmc commented May 5, 2025

  • update Logger.isEnabled signature to include context and severity number, per spec
  • remove experimental tag from isEnabled
  • accept event_name on a LogRecord
  • add event name to otlp logs payload
  • update or remove some comments that were based on the old logs-bridge specification

Closes: #1563

- update Logger.isEnabled signature to include context and severity number, per spec
- accept event_name on a LogRecord
- add event name to otlp logs payload
- update or remove some comments that were based on the old logs-bridge specification
@brettmc brettmc requested a review from a team as a code owner May 5, 2025 06:12
@codecov
Copy link

codecov bot commented May 5, 2025

Codecov Report

Attention: Patch coverage is 41.66667% with 7 lines in your changes missing coverage. Please review.

Project coverage is 70.79%. Comparing base (91e05d9) to head (f3141a9).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/API/Logs/LogRecord.php 0.00% 3 Missing ⚠️
src/SDK/Logs/ReadableLogRecord.php 33.33% 2 Missing ⚠️
src/API/Logs/LateBindingLogger.php 0.00% 1 Missing ⚠️
src/Contrib/Otlp/LogsConverter.php 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1580      +/-   ##
============================================
- Coverage     70.86%   70.79%   -0.07%     
- Complexity     2765     2768       +3     
============================================
  Files           407      407              
  Lines          8346     8357      +11     
============================================
+ Hits           5914     5916       +2     
- Misses         2432     2441       +9     
Flag Coverage Δ
8.1 70.54% <41.66%> (-0.02%) ⬇️
8.2 70.76% <41.66%> (-0.03%) ⬇️
8.3 70.72% <41.66%> (-0.09%) ⬇️
8.4 70.72% <41.66%> (-0.07%) ⬇️

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

Files with missing lines Coverage Δ
src/API/Logs/NoopLogger.php 100.00% <100.00%> (ø)
src/SDK/Logs/Logger.php 88.88% <100.00%> (ø)
src/API/Logs/LateBindingLogger.php 66.66% <0.00%> (ø)
src/Contrib/Otlp/LogsConverter.php 92.50% <66.66%> (-1.01%) ⬇️
src/SDK/Logs/ReadableLogRecord.php 89.47% <33.33%> (-4.82%) ⬇️
src/API/Logs/LogRecord.php 90.00% <0.00%> (-10.00%) ⬇️

... and 5 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 91e05d9...f3141a9. Read the comment docs.

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

* emit a LogRecord, to ensure they have the most up-to-date response.
*/
public function isEnabled(): bool;
public function isEnabled(?ContextInterface $context = null, ?int $severityNumber = null): bool;
Copy link
Contributor

Choose a reason for hiding this comment

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

Changing this would break backwards compatibility; should this PR target 2.x instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since it was marked as @experimental, I think that breaking is allowable.

@ChrisLightfootWild ChrisLightfootWild requested a review from a team May 5, 2025 17:11
@ChrisLightfootWild ChrisLightfootWild requested a review from a team May 6, 2025 08:15
@bobstrecansky bobstrecansky merged commit 4851a4e into open-telemetry:main May 7, 2025
10 of 11 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.

stabilize logger.enabled

3 participants