cli: fix milliseconds formatting on logs (#5507)

This commit is contained in:
André Silva
2020-04-02 19:16:45 +01:00
committed by GitHub
parent 9a14d45a13
commit 2e720f93a2
+2 -2
View File
@@ -186,8 +186,8 @@ pub fn init_logger(pattern: &str) {
let name = ::std::thread::current()
.name()
.map_or_else(Default::default, |x| format!("{}", Colour::Blue.bold().paint(x)));
let millis = (now.tm_nsec as f32 / 1000000.0).round() as usize;
let timestamp = format!("{}.{:03}", timestamp, millis);
let millis = (now.tm_nsec as f32 / 1000000.0).floor() as usize;
let timestamp = format!("{}.{}", timestamp, millis);
format!(
"{} {} {} {} {}",
Colour::Black.bold().paint(timestamp),