Trait opentelemetry::logs::Logger
source · pub trait Logger {
// Required methods
fn emit(&self, record: LogRecord);
fn event_enabled(&self, level: Severity, target: &str) -> bool;
}
Available on crate feature
logs
only.Expand description
The interface for emitting LogRecord
s.
Required Methods§
sourcefn emit(&self, record: LogRecord)
fn emit(&self, record: LogRecord)
Emit a LogRecord
. If there is active current thread’s Context
,
the logger will set the record’s TraceContext
to the active trace context,
sourcefn event_enabled(&self, level: Severity, target: &str) -> bool
fn event_enabled(&self, level: Severity, target: &str) -> bool
Available on crate feature
logs_level_enabled
only.Check if the given log level is enabled.