修复不加日志启动失败的问题
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user