pub struct LogMessage {
pub timestamp: DateTime<Utc>,
pub level: LogLevel,
pub message: String,
pub instance_id: String,
pub component_id: String,
pub component_type: ComponentType,
}Expand description
Log level and log message types for component log streaming A structured log message from a component.
Contains the log content along with metadata about when and where the log was generated.
Fields§
§timestamp: DateTime<Utc>Timestamp when the log was emitted
level: LogLevelSeverity level of the log
message: StringThe log message content
instance_id: StringID of the DrasiLib instance that owns the component
component_id: StringID of the component that emitted the log
component_type: ComponentTypeType of the component (Source, Query, Reaction)
Implementations§
Source§impl LogMessage
impl LogMessage
Sourcepub fn new(
level: LogLevel,
message: impl Into<String>,
component_id: impl Into<String>,
component_type: ComponentType,
) -> Self
pub fn new( level: LogLevel, message: impl Into<String>, component_id: impl Into<String>, component_type: ComponentType, ) -> Self
Create a new log message with the current timestamp.
Sourcepub fn with_instance(
level: LogLevel,
message: impl Into<String>,
instance_id: impl Into<String>,
component_id: impl Into<String>,
component_type: ComponentType,
) -> Self
pub fn with_instance( level: LogLevel, message: impl Into<String>, instance_id: impl Into<String>, component_id: impl Into<String>, component_type: ComponentType, ) -> Self
Create a new log message with instance ID.
Trait Implementations§
Source§impl Clone for LogMessage
impl Clone for LogMessage
Source§fn clone(&self) -> LogMessage
fn clone(&self) -> LogMessage
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 moreSource§impl Debug for LogMessage
impl Debug for LogMessage
Source§impl<'de> Deserialize<'de> for LogMessage
impl<'de> Deserialize<'de> for LogMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LogMessage
impl RefUnwindSafe for LogMessage
impl Send for LogMessage
impl Sync for LogMessage
impl Unpin for LogMessage
impl UnsafeUnpin for LogMessage
impl UnwindSafe for LogMessage
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