Show timestamps (fix #156)

This commit is contained in:
Roey Darwish Dror
2019-05-21 16:40:00 +03:00
parent c6b50a5fed
commit 48653f555d
3 changed files with 37 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
use chrono::{Local, Timelike};
use console::{style, Term};
use lazy_static::lazy_static;
use std::cmp::{max, min};
@@ -23,7 +24,14 @@ impl Terminal {
}
fn print_separator<P: AsRef<str>>(&mut self, message: P) {
let message = message.as_ref();
let now = Local::now();
let message = format!(
"{:02}:{:02}:{:02} - {}",
now.hour(),
now.minute(),
now.second(),
message.as_ref()
);
match self.width {
Some(width) => {
self.term