aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock34
-rw-r--r--mumlib/Cargo.toml1
-rw-r--r--mumlib/src/lib.rs3
3 files changed, 37 insertions, 1 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 2e68fa5..ccb8871 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -161,6 +161,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
+name = "chrono"
+version = "0.4.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
+dependencies = [
+ "libc",
+ "num-integer",
+ "num-traits",
+ "time",
+ "winapi",
+]
+
+[[package]]
name = "clang-sys"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -885,6 +898,7 @@ dependencies = [
name = "mumlib"
version = "0.4.0"
dependencies = [
+ "chrono",
"colored",
"dirs",
"fern",
@@ -999,6 +1013,16 @@ dependencies = [
]
[[package]]
+name = "num-integer"
+version = "0.1.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
+dependencies = [
+ "autocfg",
+ "num-traits",
+]
+
+[[package]]
name = "num-traits"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1573,6 +1597,16 @@ dependencies = [
]
[[package]]
+name = "time"
+version = "0.1.43"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
+dependencies = [
+ "libc",
+ "winapi",
+]
+
+[[package]]
name = "tokio"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/mumlib/Cargo.toml b/mumlib/Cargo.toml
index bda026b..5c9d4e1 100644
--- a/mumlib/Cargo.toml
+++ b/mumlib/Cargo.toml
@@ -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') {