Struct opentelemetry::logs::LogRecordBuilder
source · pub struct LogRecordBuilder { /* private fields */ }
Available on crate feature
logs
only.Expand description
A builder for LogRecord
values.
Implementations§
source§impl LogRecordBuilder
impl LogRecordBuilder
sourcepub fn new() -> LogRecordBuilder
pub fn new() -> LogRecordBuilder
Create a new LogRecordBuilder
sourcepub fn with_timestamp(self, timestamp: SystemTime) -> LogRecordBuilder
pub fn with_timestamp(self, timestamp: SystemTime) -> LogRecordBuilder
Assign timestamp
sourcepub fn with_observed_timestamp(self, timestamp: SystemTime) -> LogRecordBuilder
pub fn with_observed_timestamp(self, timestamp: SystemTime) -> LogRecordBuilder
Assign observed timestamp
sourcepub fn with_span_context(self, span_context: &SpanContext) -> LogRecordBuilder
pub fn with_span_context(self, span_context: &SpanContext) -> LogRecordBuilder
Assign the record’s TraceContext
sourcepub fn with_context<T>(self, context: &T) -> LogRecordBuilderwhere
T: TraceContextExt,
pub fn with_context<T>(self, context: &T) -> LogRecordBuilderwhere T: TraceContextExt,
Assign the record’s TraceContext
from a TraceContextExt
trait
sourcepub fn with_severity_text<T>(self, severity: T) -> LogRecordBuilderwhere
T: Into<Cow<'static, str>>,
pub fn with_severity_text<T>(self, severity: T) -> LogRecordBuilderwhere T: Into<Cow<'static, str>>,
Assign severity text
sourcepub fn with_severity_number(self, severity: Severity) -> LogRecordBuilder
pub fn with_severity_number(self, severity: Severity) -> LogRecordBuilder
Assign severity number
sourcepub fn with_body(self, body: AnyValue) -> LogRecordBuilder
pub fn with_body(self, body: AnyValue) -> LogRecordBuilder
Assign body
sourcepub fn with_attributes(
self,
attributes: Vec<(Key, AnyValue), Global>
) -> LogRecordBuilder
pub fn with_attributes( self, attributes: Vec<(Key, AnyValue), Global> ) -> LogRecordBuilder
Assign attributes. The SDK doesn’t carry on any deduplication on these attributes.
sourcepub fn with_attribute<K, V>(self, key: K, value: V) -> LogRecordBuilderwhere
K: Into<Key>,
V: Into<AnyValue>,
pub fn with_attribute<K, V>(self, key: K, value: V) -> LogRecordBuilderwhere K: Into<Key>, V: Into<AnyValue>,
Set a single attribute for this record. The SDK doesn’t carry on any deduplication on these attributes.
Trait Implementations§
source§impl Clone for LogRecordBuilder
impl Clone for LogRecordBuilder
source§fn clone(&self) -> LogRecordBuilder
fn clone(&self) -> LogRecordBuilder
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 LogRecordBuilder
impl Debug for LogRecordBuilder
source§impl Default for LogRecordBuilder
impl Default for LogRecordBuilder
source§fn default() -> LogRecordBuilder
fn default() -> LogRecordBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for LogRecordBuilder
impl Send for LogRecordBuilder
impl Sync for LogRecordBuilder
impl Unpin for LogRecordBuilder
impl UnwindSafe for LogRecordBuilder
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