don't truncate DateTime nanoseconds

where we don't care about them anyway..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2020-09-11 14:34:35 +02:00
committed by Dietmar Maurer
parent 4a363fb4a7
commit 151acf5d96
5 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,5 @@
use anyhow::{Error};
use chrono::{TimeZone, Local};
use chrono::Local;
use std::io::Write;
/// Log messages with timestamps into files
@ -56,7 +56,7 @@ impl FileLogger {
stdout.write_all(b"\n").unwrap();
}
let line = format!("{}: {}\n", Local.timestamp(Local::now().timestamp(), 0).to_rfc3339(), msg);
let line = format!("{}: {}\n", Local::now().to_rfc3339(), msg);
self.file.write_all(line.as_bytes()).unwrap();
}
}