-
Notifications
You must be signed in to change notification settings - Fork 501
Open
Labels
Staleabi:version_2Fix is available WITH_ABI_VERSION_2Fix is available WITH_ABI_VERSION_2breaking changeAPI or ABI breaking changeAPI or ABI breaking changebugSomething isn't workingSomething isn't workinghelp wantedGood for taking. Extra help will be provided by maintainersGood for taking. Extra help will be provided by maintainerstriage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.
Description
nostd::shared_ptr<opentelemetry::logs::Logger> logger = ...;
if (logger->Enabled(severity)) {
}
Logger::Enabled() always return false.
This is due to:
inline bool Enabled(Severity severity) const noexcept
{
return static_cast<uint8_t>(severity) >= OPENTELEMETRY_ATOMIC_READ_8(&minimum_severity_);
}
mutable uint8_t minimum_severity_{kMaxSeverity};
The severity is kMaxSeverity by default, meaning all events are disabled by default.
There is a method to change the logger severity:
void SetMinimumSeverity(uint8_t severity_or_max) noexcept
{
OPENTELEMETRY_ATOMIC_WRITE_8(&minimum_severity_, severity_or_max);
}
but is it protected, and never called in the code base.
Any user code that checks for Enabled() can not emit logs.
Note that EmitLogRecord() helpers never honor the Enabled() flag either.
Metadata
Metadata
Assignees
Labels
Staleabi:version_2Fix is available WITH_ABI_VERSION_2Fix is available WITH_ABI_VERSION_2breaking changeAPI or ABI breaking changeAPI or ABI breaking changebugSomething isn't workingSomething isn't workinghelp wantedGood for taking. Extra help will be provided by maintainersGood for taking. Extra help will be provided by maintainerstriage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.