mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-28 16:30:52 +08:00
fix: correct log cleanup day mapping and update logging level #4434
This commit is contained in:
@@ -390,7 +390,7 @@ impl IVerge {
|
||||
auto_close_connection: Some(true),
|
||||
auto_check_update: Some(true),
|
||||
enable_builtin_enhanced: Some(true),
|
||||
auto_log_clean: Some(2),
|
||||
auto_log_clean: Some(2), // 1: 1天, 2: 7天, 3: 30天, 4: 90天
|
||||
webdav_url: None,
|
||||
webdav_username: None,
|
||||
webdav_password: None,
|
||||
|
||||
@@ -78,14 +78,16 @@ pub fn delete_log() -> Result<()> {
|
||||
verge.auto_log_clean.unwrap_or(0)
|
||||
};
|
||||
|
||||
// 1: 1天, 2: 7天, 3: 30天, 4: 90天
|
||||
let day = match auto_log_clean {
|
||||
1 => 7,
|
||||
2 => 30,
|
||||
3 => 90,
|
||||
1 => 1,
|
||||
2 => 7,
|
||||
3 => 30,
|
||||
4 => 90,
|
||||
_ => return Ok(()),
|
||||
};
|
||||
|
||||
log::debug!(target: "app", "try to delete log files, day: {day}");
|
||||
log::info!(target: "app", "try to delete log files, day: {day}");
|
||||
|
||||
// %Y-%m-%d to NaiveDateTime
|
||||
let parse_time_str = |s: &str| {
|
||||
|
||||
Reference in New Issue
Block a user