Struct mini_functions::hash::loggers::Log
source · pub struct Log {
pub session_id: String,
pub time: String,
pub level: LogLevel,
pub component: String,
pub description: String,
pub format: LogFormat,
}
Expand description
Struct representing a log message.
Contains all the elements that make up a complete log message.
Fields§
§session_id: String
A string 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: String
A string that holds the timestamp in ISO 8601 format.
level: LogLevel
A string that holds the level (INFO, WARN, ERROR, etc.).
component: String
A string that holds the component name.
description: String
A string that holds the description of the log message.
format: LogFormat
A string that holds the log format.
Implementations§
source§impl Log
impl Log
sourcepub fn log(&self) -> Result<(), Error>
pub fn log(&self) -> Result<(), Error>
Logs a message to the console using a pre-allocated buffer to reduce memory allocation and flush the output buffer to ensure that the message is written immediately.
Errors
This function will panic if an error occurs when writing to the pre-allocated buffer or flushing the output buffer.
Trait Implementations§
source§impl Default for Log
impl Default for Log
Provides default values for Log
.
This implementation provides a quick way to generate a Log
instance with default values.
impl Eq for Log
impl StructuralEq for Log
impl 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§
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
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.