diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-04-10 17:10:04 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-04-10 19:57:09 +0200 |
| commit | 28ada847437be5d8215d529ad48eff289dc32085 (patch) | |
| tree | 354b83642f08ee20af3c5a5a22af368b5b411479 /mumlib/src/lib.rs | |
| parent | 1bce45d619c74a7f9d7c7dd394e94f87b4a9dc55 (diff) | |
| download | mum-28ada847437be5d8215d529ad48eff289dc32085.tar.gz | |
add date and time to log output
Diffstat (limited to 'mumlib/src/lib.rs')
| -rw-r--r-- | mumlib/src/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
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') { |
