Skip to content

Conversation

@dmehala
Copy link
Collaborator

@dmehala dmehala commented Feb 15, 2025

Description

The library now uses a NullLogger by default if no logger is specified. This means that no logs will be printed unless a customer logger is provided.

Motivation

It’s generally better for a library to not log by default but instead allow the user to configure logging. It avoids unwanted noises, avoids conflicts with application logging and respects user control (the binary using our library should dictate how logs are handled).

@dmehala dmehala requested a review from a team as a code owner February 15, 2025 14:38
@dmehala dmehala requested review from dubloom and removed request for a team February 15, 2025 14:38
@dmehala dmehala force-pushed the dmehala/no-default-logger branch from 49314dc to e6c5679 Compare February 15, 2025 14:40
@pr-commenter
Copy link

pr-commenter bot commented Feb 15, 2025

Benchmarks

Benchmark execution time: 2025-02-18 20:16:56

Comparing candidate commit 866dee4 in PR branch dmehala/no-default-logger with baseline commit f3ebccc in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

@codecov-commenter
Copy link

codecov-commenter commented Feb 15, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.56%. Comparing base (f3ebccc) to head (866dee4).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/datadog/null_logger.h 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #187      +/-   ##
==========================================
- Coverage   93.60%   93.56%   -0.05%     
==========================================
  Files          73       74       +1     
  Lines        4256     4260       +4     
==========================================
+ Hits         3984     3986       +2     
- Misses        272      274       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

The library now uses a NullLogger by default if no logger is specified.
This means that no logs will be printed unless a customer logger is
provided.

 Author:    Damien MEHALA <damien.mehala@datadoghq.com>
@dmehala dmehala force-pushed the dmehala/no-default-logger branch from e6c5679 to 866dee4 Compare February 18, 2025 20:13
@dmehala dmehala merged commit 9f7d0aa into main Feb 18, 2025
21 checks passed
@dmehala dmehala deleted the dmehala/no-default-logger branch February 18, 2025 20:21
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.

4 participants