simplify default formatter for mobile

pull/96/head
Lucas Nogueira 2 years ago
parent df21598a48
commit 5f13148aad
No known key found for this signature in database
GPG Key ID: FFEA6C72E73482F1

@ -155,13 +155,18 @@ impl Default for Builder {
time::format_description::parse("[[[year]-[month]-[day]][[[hour]:[minute]:[second]]") time::format_description::parse("[[[year]-[month]-[day]][[[hour]:[minute]:[second]]")
.unwrap(); .unwrap();
let dispatch = fern::Dispatch::new().format(move |out, message, record| { let dispatch = fern::Dispatch::new().format(move |out, message, record| {
out.finish(format_args!( out.finish(
#[cfg(mobile)]
format_args!("[{}] {}", record.target(), message),
#[cfg(desktop)]
format_args!(
"{}[{}][{}] {}", "{}[{}][{}] {}",
time::OffsetDateTime::now_utc().format(&format).unwrap(), time::OffsetDateTime::now_utc().format(&format).unwrap(),
record.target(), record.target(),
record.level(), record.level(),
message message
)) ),
)
}); });
Self { Self {
dispatch, dispatch,

Loading…
Cancel
Save