diff options
Diffstat (limited to 'mumlib')
| -rw-r--r-- | mumlib/Cargo.toml | 3 | ||||
| -rw-r--r-- | mumlib/src/lib.rs | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/mumlib/Cargo.toml b/mumlib/Cargo.toml index 245b108..5c9d4e1 100644 --- a/mumlib/Cargo.toml +++ b/mumlib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mumlib" -version = "0.3.0" +version = "0.4.0" authors = ["Gustav Sörnäs <gustav@sornas.net>", "Eskil Queseth <eskilq@kth.se>"] edition = "2018" @@ -13,6 +13,7 @@ readme = "../README.md" [dependencies] colored = "2" +chrono = "0.4" dirs = "3" fern = "0.6" log = "0.4" diff --git a/mumlib/src/lib.rs b/mumlib/src/lib.rs index 36edc10..9b7d686 100644 --- a/mumlib/src/lib.rs +++ b/mumlib/src/lib.rs @@ -16,7 +16,7 @@ pub fn setup_logger<T: Into<fern::Output>>(target: T, color: bool) { .format(move |out, message, record| { let message = message.to_string(); out.finish(format_args!( - "{} {}:{}{}{}", + "{} {} {}:{}{}{}", //TODO runtime flag that disables color if color { match record.level() { @@ -36,6 +36,7 @@ pub fn setup_logger<T: Into<fern::Output>>(target: T, color: bool) { } .normal() }, + chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S%.6f]"), record.file().unwrap(), record.line().unwrap(), if message.chars().any(|e| e == '\n') { |
