#[non_exhaustive]pub struct SdkLogRecord { /* private fields */ }
Expand description
LogRecord represents all data carried by a log record, and
is provided to LogExporter
s as input.
Implementations§
Source§impl SdkLogRecord
impl SdkLogRecord
Sourcepub fn event_name(&self) -> Option<&'static str>
pub fn event_name(&self) -> Option<&'static str>
Returns the event name
Sourcepub fn timestamp(&self) -> Option<SystemTime>
pub fn timestamp(&self) -> Option<SystemTime>
Returns the timestamp
Sourcepub fn observed_timestamp(&self) -> Option<SystemTime>
pub fn observed_timestamp(&self) -> Option<SystemTime>
Returns the observed timestamp
Sourcepub fn trace_context(&self) -> Option<&TraceContext>
pub fn trace_context(&self) -> Option<&TraceContext>
Returns the trace context
Sourcepub fn severity_text(&self) -> Option<&'static str>
pub fn severity_text(&self) -> Option<&'static str>
Returns the severity text
Sourcepub fn severity_number(&self) -> Option<Severity>
pub fn severity_number(&self) -> Option<Severity>
Returns the severity number
Sourcepub fn attributes_iter(&self) -> impl Iterator<Item = &(Key, AnyValue)>
pub fn attributes_iter(&self) -> impl Iterator<Item = &(Key, AnyValue)>
Provides an iterator over the attributes.
Trait Implementations§
Source§impl Clone for SdkLogRecord
impl Clone for SdkLogRecord
Source§fn clone(&self) -> SdkLogRecord
fn clone(&self) -> SdkLogRecord
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SdkLogRecord
impl Debug for SdkLogRecord
Source§impl LogRecord for SdkLogRecord
impl LogRecord for SdkLogRecord
Source§fn set_event_name(&mut self, name: &'static str)
fn set_event_name(&mut self, name: &'static str)
Sets the
event_name
of a recordSource§fn set_target<T>(&mut self, _target: T)
fn set_target<T>(&mut self, _target: T)
Sets the
target
of a record.
Currently, both opentelemetry-appender-tracing
and opentelemetry-appender-log
create a single logger
with a scope that doesn’t accurately reflect the component emitting the logs.
Exporters MAY use this field to override the instrumentation_scope.name
.Source§fn set_timestamp(&mut self, timestamp: SystemTime)
fn set_timestamp(&mut self, timestamp: SystemTime)
Sets the time when the event occurred measured by the origin clock, i.e. the time at the source.
Source§fn set_observed_timestamp(&mut self, timestamp: SystemTime)
fn set_observed_timestamp(&mut self, timestamp: SystemTime)
Sets the observed event timestamp.
Source§fn set_severity_text(&mut self, severity_text: &'static str)
fn set_severity_text(&mut self, severity_text: &'static str)
Sets severity as text.
Source§fn set_severity_number(&mut self, severity_number: Severity)
fn set_severity_number(&mut self, severity_number: Severity)
Sets severity as a numeric value.
Source§fn add_attributes<I, K, V>(&mut self, attributes: I)
fn add_attributes<I, K, V>(&mut self, attributes: I)
Adds multiple attributes.
Source§fn add_attribute<K, V>(&mut self, key: K, value: V)
fn add_attribute<K, V>(&mut self, key: K, value: V)
Adds a single attribute.
Source§fn set_trace_context(
&mut self,
trace_id: TraceId,
span_id: SpanId,
trace_flags: Option<TraceFlags>,
)
fn set_trace_context( &mut self, trace_id: TraceId, span_id: SpanId, trace_flags: Option<TraceFlags>, )
Sets the trace context of the log.
Source§impl PartialEq for SdkLogRecord
impl PartialEq for SdkLogRecord
impl StructuralPartialEq for SdkLogRecord
Auto Trait Implementations§
impl Freeze for SdkLogRecord
impl RefUnwindSafe for SdkLogRecord
impl Send for SdkLogRecord
impl Sync for SdkLogRecord
impl Unpin for SdkLogRecord
impl UnwindSafe for SdkLogRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more