-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove default logger name #2316
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2316 +/- ##
=====================================
Coverage 79.5% 79.5%
=====================================
Files 123 123
Lines 21258 21258
=====================================
Hits 16907 16907
Misses 4351 4351 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
impl opentelemetry::logs::LoggerProvider for LoggerProvider { | ||
type Logger = Logger; | ||
|
||
fn logger(&self, name: impl Into<Cow<'static, str>>) -> Self::Logger { | ||
let mut name = name.into(); | ||
let name = name.into(); | ||
|
||
if name.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets add a test for this?
Changes
As per the specs - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#logger-creation
In the case where an invalid name (null or empty string) is specified, a working Logger MUST be returned as a fallback rather than returning null or throwing an exception, its name SHOULD keep the original invalid value, and a message reporting that the specified value is invalid SHOULD be logged.
So changed the implementation to create the instrumentation scope with empty
name
if provided and log the warning.Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes