Struct SdkLogRecord
#[non_exhaustive]pub struct SdkLogRecord { /* private fields */ }Expand description
LogRecord represents all data carried by a log record, and
is provided to LogExporters as input.
Implementations§
§impl SdkLogRecord
impl SdkLogRecord
pub fn event_name(&self) -> Option<&'static str>
pub fn event_name(&self) -> Option<&'static str>
Returns the event name
pub fn timestamp(&self) -> Option<SystemTime>
pub fn timestamp(&self) -> Option<SystemTime>
Returns the timestamp
pub fn observed_timestamp(&self) -> Option<SystemTime>
pub fn observed_timestamp(&self) -> Option<SystemTime>
Returns the observed timestamp
pub fn trace_context(&self) -> Option<&TraceContext>
pub fn trace_context(&self) -> Option<&TraceContext>
Returns the trace context
pub fn severity_text(&self) -> Option<&'static str>
pub fn severity_text(&self) -> Option<&'static str>
Returns the severity text
pub fn severity_number(&self) -> Option<Severity>
pub fn severity_number(&self) -> Option<Severity>
Returns the severity number
pub 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§
§impl Clone for SdkLogRecord
impl Clone for SdkLogRecord
§fn clone(&self) -> SdkLogRecord
fn clone(&self) -> SdkLogRecord
Returns a duplicate 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 more§impl Debug for SdkLogRecord
impl Debug for SdkLogRecord
§impl From<&SdkLogRecord> for LogRecord
impl From<&SdkLogRecord> for LogRecord
§fn from(log_record: &SdkLogRecord) -> LogRecord
fn from(log_record: &SdkLogRecord) -> LogRecord
Converts to this type from the input type.
§impl LogRecord for SdkLogRecord
impl LogRecord for SdkLogRecord
§fn set_event_name(&mut self, name: &'static str)
fn set_event_name(&mut self, name: &'static str)
Sets the
event_name of a record§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.§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.
§fn set_observed_timestamp(&mut self, timestamp: SystemTime)
fn set_observed_timestamp(&mut self, timestamp: SystemTime)
Sets the observed event timestamp.
§fn set_severity_text(&mut self, severity_text: &'static str)
fn set_severity_text(&mut self, severity_text: &'static str)
Sets severity as text.
§fn set_severity_number(&mut self, severity_number: Severity)
fn set_severity_number(&mut self, severity_number: Severity)
Sets severity as a numeric value.
§fn add_attributes<I, K, V>(&mut self, attributes: I)
fn add_attributes<I, K, V>(&mut self, attributes: I)
Adds multiple attributes.
§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.
§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.
§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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more