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;
}
}