mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
simplify default formatter for mobile
This commit is contained in:
+12
-7
@@ -155,13 +155,18 @@ impl Default for Builder {
|
||||
time::format_description::parse("[[[year]-[month]-[day]][[[hour]:[minute]:[second]]")
|
||||
.unwrap();
|
||||
let dispatch = fern::Dispatch::new().format(move |out, message, record| {
|
||||
out.finish(format_args!(
|
||||
"{}[{}][{}] {}",
|
||||
time::OffsetDateTime::now_utc().format(&format).unwrap(),
|
||||
record.target(),
|
||||
record.level(),
|
||||
message
|
||||
))
|
||||
out.finish(
|
||||
#[cfg(mobile)]
|
||||
format_args!("[{}] {}", record.target(), message),
|
||||
#[cfg(desktop)]
|
||||
format_args!(
|
||||
"{}[{}][{}] {}",
|
||||
time::OffsetDateTime::now_utc().format(&format).unwrap(),
|
||||
record.target(),
|
||||
record.level(),
|
||||
message
|
||||
),
|
||||
)
|
||||
});
|
||||
Self {
|
||||
dispatch,
|
||||
|
||||
Reference in New Issue
Block a user