pub struct LogConfig {
pub level: String,
pub log_file: Option<String>,
pub console_output: bool,
pub show_timestamp: bool,
pub show_target: bool,
pub show_thread: bool,
}Expand description
Log configuration structure
Fields§
§level: StringLog level (trace, debug, info, warn, error)
log_file: Option<String>Log file path (optional)
console_output: boolEnable console output
show_timestamp: boolShow timestamp
show_target: boolShow code location information
show_thread: boolShow thread information
Implementations§
Source§impl LogConfig
impl LogConfig
Sourcepub fn with_level(self, level: &str) -> Self
pub fn with_level(self, level: &str) -> Self
Set log level
Sourcepub fn with_log_file<P: AsRef<Path>>(self, file: P) -> Self
pub fn with_log_file<P: AsRef<Path>>(self, file: P) -> Self
Set log file path
Sourcepub fn with_console_output(self, enabled: bool) -> Self
pub fn with_console_output(self, enabled: bool) -> Self
Enable/disable console output
Sourcepub fn with_timestamp(self, enabled: bool) -> Self
pub fn with_timestamp(self, enabled: bool) -> Self
Enable/disable timestamp display
Sourcepub fn with_target(self, enabled: bool) -> Self
pub fn with_target(self, enabled: bool) -> Self
Enable/disable target information display
Sourcepub fn with_thread(self, enabled: bool) -> Self
pub fn with_thread(self, enabled: bool) -> Self
Enable/disable thread information display
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogConfig
impl RefUnwindSafe for LogConfig
impl Send for LogConfig
impl Sync for LogConfig
impl Unpin for LogConfig
impl UnsafeUnpin for LogConfig
impl UnwindSafe for LogConfig
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