Struct LogMessage
pub struct LogMessage<'a> {
pub time_unix_nano: u64,
pub severity: Severity,
pub body: Cow<'a, str>,
pub attributes: Cow<'a, [KeyValue<'a>]>,
pub trace_id: Option<TraceId>,
pub span_id: Option<SpanId>,
}
Expand description
A structured log message with severity, timestamp, and attributes.
Log messages can be optionally correlated with traces by including trace and span IDs when available.
Fields§
§time_unix_nano: u64
Timestamp in nanoseconds since Unix epoch (or system start)
severity: Severity
The severity level of this log message
body: Cow<'a, str>
The message body
attributes: Cow<'a, [KeyValue<'a>]>
Key-value attributes providing additional context
trace_id: Option<TraceId>
Optional trace ID for correlation with traces
span_id: Option<SpanId>
Optional span ID for correlation with traces
Trait Implementations§
§impl<'a> Clone for LogMessage<'a>
impl<'a> Clone for LogMessage<'a>
§fn clone(&self) -> LogMessage<'a>
fn clone(&self) -> LogMessage<'a>
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<'a> Debug for LogMessage<'a>
impl<'a> Debug for LogMessage<'a>
§impl<'de, 'a> Deserialize<'de> for LogMessage<'a>where
'de: 'a,
impl<'de, 'a> Deserialize<'de> for LogMessage<'a>where
'de: 'a,
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LogMessage<'a>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LogMessage<'a>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<'a> Serialize for LogMessage<'a>
impl<'a> Serialize for LogMessage<'a>
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl ToStatic for LogMessage<'_>
impl ToStatic for LogMessage<'_>
§type Static = LogMessage<'static>
type Static = LogMessage<'static>
The same type but with ’static lifetime and owned data.
Auto Trait Implementations§
impl<'a> Freeze for LogMessage<'a>
impl<'a> RefUnwindSafe for LogMessage<'a>
impl<'a> Send for LogMessage<'a>
impl<'a> Sync for LogMessage<'a>
impl<'a> Unpin for LogMessage<'a>
impl<'a> UnwindSafe for LogMessage<'a>
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