diff --git a/src/main.rs b/src/main.rs index 79958f1..97c424c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,7 +35,13 @@ fn print_delete_line(output: &mut StdoutLock) -> LogtimesResult { } fn run() -> LogtimesResult { - let mut log_file = args().nth(1).map(|f| File::create(f).unwrap()); + let mut log_file = args().nth(1).map(|f| { + File::options() + .create(true) + .append(true) + .open(f) + .expect("Could not open log file") + }); let out = stdout(); let mut output = out.lock();