pub struct LogConfig {
pub time_format: String,
pub enable_ansi: bool,
pub show_target: bool,
pub show_thread_ids: bool,
pub compact_format: bool,
pub console_level: LevelFilter,
pub file_level: LevelFilter,
}Expand description
日志配置结构
Fields§
§time_format: String时间格式字符串
enable_ansi: bool是否启用ANSI颜色(控制台)
show_target: bool是否显示目标模块
show_thread_ids: bool是否显示线程ID
compact_format: bool是否使用紧凑格式
console_level: LevelFilter控制台日志级别
file_level: LevelFilter文件日志级别
Implementations§
Source§impl LogConfig
impl LogConfig
Sourcepub fn time_format(self, format: impl Into<String>) -> Self
pub fn time_format(self, format: impl Into<String>) -> Self
设置时间格式
Sourcepub fn thread_ids(self, show: bool) -> Self
pub fn thread_ids(self, show: bool) -> Self
显示/隐藏线程ID
Sourcepub fn console_level(self, level: LevelFilter) -> Self
pub fn console_level(self, level: LevelFilter) -> Self
设置控制台日志级别
Sourcepub fn file_level(self, level: LevelFilter) -> Self
pub fn file_level(self, level: LevelFilter) -> Self
设置文件日志级别
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 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