Releases: rbatis/fast_log
Releases · rbatis/fast_log
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.3.31
v1.3.29
v1.3.27
v1.3.26
v1.3.24
v1.3.21
v1.3.21
- add log format
/// format record data
pub trait RecordFormat: Send {
fn do_format(&self, arg: &mut FastLogRecord);
}
pub struct FastLogFormatRecord {}
impl RecordFormat for FastLogFormatRecord {
fn do_format(&self, arg: &mut FastLogRecord) {
let data;
let now = format!("{:36}", arg.now.to_string());
match arg.level {
Level::Warn | Level::Error => {
data = format!("{} {} {} - {} {}\n", &now, arg.level, arg.module_path, arg.args, arg.format_line());
}
_ => {
data = format!("{} {} {} - {}\n", &now, arg.level, arg.module_path, arg.args);
}
}
arg.formated = data;
}
}