Struct mini_functions::log::Log
source · #[non_exhaustive]pub struct Log { /* private fields */ }Expand description
Implements Log to log a message to the console with a simple, readable output format.
Arguments
session_id- A string slice that holds a session ID. The session ID is a unique identifier for the current session. A random GUID (Globally Unique Identifier) is generated by default.time- A string slice that holds the timestamp in ISO 8601 format.level- A string slice that holds the level (INFO, WARN, ERROR, etc.).component- A string slice that holds the component name.description- A string slice that holds the description of the log message.
Examples
use mini_functions::log::Log;
let log = Log::new(
"12345678-1234-1234-1234-1234567890ab",
"2023-12-23T23:23:23.222222+00:00",
"INFO",
"SystemTrayEvent",
"Showing main window",
);Implementations§
source§impl Log
impl Log
sourcepub fn new(
session_id: &str,
time: &str,
level: &str,
component: &str,
description: &str
) -> Self
pub fn new(
session_id: &str,
time: &str,
level: &str,
component: &str,
description: &str
) -> Self
Create a new Log instance.
Arguments
session_id- A string slice that holds a session ID. The session ID is a unique identifier for the current session. A random GUID (Globally Unique Identifier) is generated by default.time- A string slice that holds the timestamp in ISO 8601 format.level- A string slice that holds the level (INFO, WARN, ERROR, etc.).component- A string slice that holds the component name.description- A string slice that holds the description of the log message.
Returns
A new Log instance.
Examples
use mini_functions::log::Log;
let log = Log::new(
"12345678-1234-1234-1234-1234567890ab",
"2023-12-23T23:23:23.222222+00:00",
"INFO",
"SystemTrayEvent",
"Showing main window",
);Trait Implementations§
source§impl PartialOrd<Log> for Log
impl PartialOrd<Log> for Log
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl StructuralPartialEq for Log
Auto Trait Implementations§
impl RefUnwindSafe for Log
impl Send for Log
impl Sync for Log
impl Unpin for Log
impl UnwindSafe for Log
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().