[fix] log file needs to be opened create + append

This commit is contained in:
ddidderr 2022-08-04 18:50:07 +02:00
parent a8ca38f4a4
commit 91ec9ab7ec
Signed by: ddidderr
GPG Key ID: 3841F1C27E6F0E14

View File

@ -35,7 +35,13 @@ fn print_delete_line(output: &mut StdoutLock) -> LogtimesResult {
} }
fn run() -> 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 out = stdout();
let mut output = out.lock(); let mut output = out.lock();