use super::LogLevel;
#[derive(Debug)]
pub struct Setting {
pub dir_path: String,
pub single_length: usize,
pub file_record_level: LogLevel,
pub terminal_print_level: LogLevel,
pub time_detailed_display: bool,
pub file_time_format: String,
pub time_zone: i32,
pub print_out: bool,
pub disabled: bool,
}
impl std::default::Default for Setting {
fn default() -> Self {
let terminal_print_level = if cfg!(debug_assertions) {
LogLevel::Debug
} else {
LogLevel::Info
};
Setting {
dir_path: "./logs".to_string(),
single_length: 0,
file_record_level: LogLevel::Trace,
terminal_print_level,
time_detailed_display: false,
file_time_format: "%Y-%m-%d".to_string(),
time_zone: 0,
print_out: false,
disabled: false,
}
}
}
unsafe impl Send for Setting {}