Skip to content

Commit 9ce0e04

Browse files
committed
fix(logs): add platform-specific newline
1 parent 752ce10 commit 9ce0e04

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src-tauri/src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,21 @@ pub fn run() {
1616
"[year]-[month]-[day] [hour]:[minute]:[second]",
1717
)
1818
.unwrap();
19+
20+
let newline = match tauri_plugin_os::platform() {
21+
"windows" => "\r",
22+
_ => "",
23+
};
24+
1925
out.finish(format_args!(
20-
"[{}][{}] {}",
26+
"[{}][{}] {}{}",
2127
tauri_plugin_log::TimezoneStrategy::UseUtc
2228
.get_now()
2329
.format(&tf)
2430
.unwrap(),
2531
record.level(),
26-
message
32+
message,
33+
newline
2734
))
2835
})
2936
.build(),

0 commit comments

Comments
 (0)