There was an error while loading. Please reload this page.
1 parent 5cd6977 commit bc70542Copy full SHA for bc70542
1 file changed
src/main.rs
@@ -10,6 +10,7 @@ use tracing_subscriber::util::SubscriberInitExt;
10
mod data;
11
mod media;
12
mod single_instance;
13
+mod status;
14
mod ui;
15
mod updater;
16
@@ -21,10 +22,14 @@ fn main() -> anyhow::Result<()> {
21
22
std::fs::create_dir_all(&data_dir).ok();
23
24
let log_path = data_dir.join("vleer.log");
25
+ if let Ok(meta) = std::fs::metadata(&log_path)
26
+ && meta.len() > 5 * 1024 * 1024
27
+ {
28
+ let _ = std::fs::rename(&log_path, data_dir.join("vleer.log.old"));
29
+ }
30
let log_file = std::fs::OpenOptions::new()
31
.create(true)
- .write(true)
- .truncate(true)
32
+ .append(true)
33
.open(&log_path)?;
34
35
tracing_subscriber::registry()
0 commit comments