Fix panic when fs::create_dir fails for LOG_DIR when it already exists

Former-commit-id: a332a8aadc8322650beaf9ff7eead4ac162c6eec
This commit is contained in:
Michel Heily 2020-02-14 14:26:45 +02:00
parent b03fe3567e
commit 11fb9d7eda

View file

@ -61,7 +61,7 @@ fn wait_for_rom(event_pump: &mut EventPump) -> String {
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
fs::create_dir(LOG_DIR).expect(&format!("could not create log directory ({})", LOG_DIR));
fs::create_dir_all(LOG_DIR).expect(&format!("could not create log directory ({})", LOG_DIR));
flexi_logger::Logger::with_env_or_str("info")
.log_to_file()
.directory(LOG_DIR)