log: align log message timestamp

With this change, all log messages will have the same width for the
timestamp. The number of ms is rounded to 6 decimal places.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This commit is contained in:
Philipp Schuster 2023-01-09 15:38:06 +01:00 committed by Sebastien Boeuf
parent 0dc3282ae0
commit 9e8296b696

View File

@ -89,7 +89,7 @@ impl log::Log for Logger {
if record.file().is_some() && record.line().is_some() {
writeln!(
*(*(self.output.lock().unwrap())),
"cloud-hypervisor: {:?}: <{}> {}:{}:{} -- {}",
"cloud-hypervisor: {:.6?}: <{}> {}:{}:{} -- {}",
duration,
std::thread::current().name().unwrap_or("anonymous"),
record.level(),
@ -100,7 +100,7 @@ impl log::Log for Logger {
} else {
writeln!(
*(*(self.output.lock().unwrap())),
"cloud-hypervisor: {:?}: <{}> {}:{} -- {}",
"cloud-hypervisor: {:.6?}: <{}> {}:{} -- {}",
duration,
std::thread::current().name().unwrap_or("anonymous"),
record.level(),