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)]
time::OffsetDateTime::now_utc().format(&format).unwrap(), format_args!("[{}] {}", record.target(), message),
record.target(), #[cfg(desktop)]
record.level(), format_args!(
message "{}[{}][{}] {}",
)) time::OffsetDateTime::now_utc().format(&format).unwrap(),
record.target(),
record.level(),
message
),
)
}); });
Self { Self {
dispatch, dispatch,

Loading…
Cancel
Save