修复不加日志启动失败的问题

This commit is contained in:
lubeilin
2023-04-25 23:17:31 +08:00
parent 04731f1ce5
commit 9cea433a8b
2 changed files with 3 additions and 3 deletions
-3
View File
@@ -14,9 +14,6 @@ pub fn log_init_(file_name:&str) -> io::Result<()> {
} else {
return Err(io::Error::new(io::ErrorKind::Other, "not found"));
};
if !home.exists() {
std::fs::create_dir(&home)?;
}
let stderr = log4rs::append::console::ConsoleAppender::builder()
.target(log4rs::append::console::Target::Stderr)
.build();
+3
View File
@@ -245,6 +245,9 @@ pub fn read_config() -> Option<ArgsConfig> {
}
pub fn set_home(home: PathBuf) {
if !home.exists() {
std::fs::create_dir(&home).unwrap();
}
SWITCH_HOME_PATH.lock().replace(home);
}