fixes to logger

This commit is contained in:
Maxime Van Hees
2025-08-06 20:56:38 +02:00
parent 33dfc0dbe3
commit b62f1d26b0
5 changed files with 363 additions and 154 deletions

309
Cargo.lock generated
View File

@@ -12,9 +12,10 @@ dependencies = [
"clap",
"env_logger",
"hero_job",
"heromodels 0.1.0 (git+https://git.ourworld.tf/herocode/db.git)",
"heromodels-derive 0.1.0 (git+https://git.ourworld.tf/herocode/db.git)",
"heromodels_core 0.1.0 (git+https://git.ourworld.tf/herocode/db.git)",
"hero_logger",
"heromodels",
"heromodels-derive",
"heromodels_core",
"log",
"redis",
"rhai",
@@ -24,6 +25,7 @@ dependencies = [
"thiserror 1.0.69",
"tokio",
"toml",
"tracing",
"uuid",
]
@@ -197,9 +199,9 @@ dependencies = [
"env_logger",
"hero_job",
"hero_supervisor",
"heromodels 0.1.0 (git+https://git.ourworld.tf/herocode/db.git)",
"heromodels-derive 0.1.0 (git+https://git.ourworld.tf/herocode/db.git)",
"heromodels_core 0.1.0 (git+https://git.ourworld.tf/herocode/db.git)",
"heromodels",
"heromodels-derive",
"heromodels_core",
"log",
"redis",
"rhai",
@@ -481,6 +483,21 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "crossbeam-channel"
version = "0.5.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2"
dependencies = [
"crossbeam-utils",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
[[package]]
name = "crossterm"
version = "0.28.1"
@@ -557,10 +574,19 @@ dependencies = [
"syn 2.0.104",
]
[[package]]
name = "deranged"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e"
dependencies = [
"powerfmt",
]
[[package]]
name = "derive"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/rhailib.git#c37be2dfcc447538be8363296b2b465c93ad3e11"
source = "git+https://git.ourworld.tf/herocode/rhailib.git#02d9f5937ea5d5ce78f6f4a89c7400bfd1881057"
dependencies = [
"quote",
"syn 1.0.109",
@@ -964,6 +990,23 @@ dependencies = [
"uuid",
]
[[package]]
name = "hero_logger"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/baobab.git?branch=logger#9c4fa1a78bf3cbeb57802d261ee9c9fb115ba219"
dependencies = [
"anyhow",
"chrono",
"rhai",
"serde",
"serde_json",
"thiserror 1.0.69",
"tokio",
"tracing",
"tracing-appender",
"tracing-subscriber",
]
[[package]]
name = "hero_supervisor"
version = "0.1.0"
@@ -994,10 +1037,10 @@ source = "git+https://git.ourworld.tf/herocode/db.git#453e86edd24d6009f0b154ac77
dependencies = [
"bincode",
"chrono",
"heromodels-derive 0.1.0 (git+https://git.ourworld.tf/herocode/db.git)",
"heromodels_core 0.1.0 (git+https://git.ourworld.tf/herocode/db.git)",
"heromodels-derive",
"heromodels_core",
"jsonb",
"ourdb 0.1.0 (git+https://git.ourworld.tf/herocode/db.git)",
"ourdb",
"postgres",
"r2d2",
"r2d2_postgres",
@@ -1006,30 +1049,7 @@ dependencies = [
"serde_json",
"strum",
"strum_macros",
"tst 0.1.0 (git+https://git.ourworld.tf/herocode/db.git)",
"uuid",
]
[[package]]
name = "heromodels"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/rhailib.git#c37be2dfcc447538be8363296b2b465c93ad3e11"
dependencies = [
"bincode",
"chrono",
"heromodels-derive 0.1.0 (git+https://git.ourworld.tf/herocode/rhailib.git)",
"heromodels_core 0.1.0 (git+https://git.ourworld.tf/herocode/rhailib.git)",
"jsonb",
"ourdb 0.1.0 (git+https://git.ourworld.tf/herocode/rhailib.git)",
"postgres",
"r2d2",
"r2d2_postgres",
"rhai",
"serde",
"serde_json",
"strum",
"strum_macros",
"tst 0.1.0 (git+https://git.ourworld.tf/herocode/rhailib.git)",
"tst",
"uuid",
]
@@ -1043,16 +1063,6 @@ dependencies = [
"syn 2.0.104",
]
[[package]]
name = "heromodels-derive"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/rhailib.git#c37be2dfcc447538be8363296b2b465c93ad3e11"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.104",
]
[[package]]
name = "heromodels_core"
version = "0.1.0"
@@ -1062,15 +1072,6 @@ dependencies = [
"serde",
]
[[package]]
name = "heromodels_core"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/rhailib.git#c37be2dfcc447538be8363296b2b465c93ad3e11"
dependencies = [
"chrono",
"serde",
]
[[package]]
name = "hmac"
version = "0.12.1"
@@ -1812,14 +1813,23 @@ dependencies = [
[[package]]
name = "macros"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/rhailib.git#c37be2dfcc447538be8363296b2b465c93ad3e11"
source = "git+https://git.ourworld.tf/herocode/rhailib.git#02d9f5937ea5d5ce78f6f4a89c7400bfd1881057"
dependencies = [
"heromodels 0.1.0 (git+https://git.ourworld.tf/herocode/rhailib.git)",
"heromodels_core 0.1.0 (git+https://git.ourworld.tf/herocode/rhailib.git)",
"heromodels",
"heromodels_core",
"rhai",
"serde",
]
[[package]]
name = "matchers"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
dependencies = [
"regex-automata 0.1.10",
]
[[package]]
name = "md-5"
version = "0.10.6"
@@ -1898,6 +1908,22 @@ dependencies = [
"memchr",
]
[[package]]
name = "nu-ansi-term"
version = "0.46.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
dependencies = [
"overload",
"winapi",
]
[[package]]
name = "num-conv"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
[[package]]
name = "num-traits"
version = "0.2.19"
@@ -1996,15 +2022,10 @@ dependencies = [
]
[[package]]
name = "ourdb"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/rhailib.git#c37be2dfcc447538be8363296b2b465c93ad3e11"
dependencies = [
"crc32fast",
"log",
"rand 0.8.5",
"thiserror 1.0.69",
]
name = "overload"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
[[package]]
name = "parking_lot"
@@ -2166,6 +2187,12 @@ dependencies = [
"zerovec",
]
[[package]]
name = "powerfmt"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
[[package]]
name = "ppv-lite86"
version = "0.2.21"
@@ -2353,8 +2380,17 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
"regex-automata 0.4.9",
"regex-syntax 0.8.5",
]
[[package]]
name = "regex-automata"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
dependencies = [
"regex-syntax 0.6.29",
]
[[package]]
@@ -2365,9 +2401,15 @@ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
"regex-syntax 0.8.5",
]
[[package]]
name = "regex-syntax"
version = "0.6.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "regex-syntax"
version = "0.8.5"
@@ -2467,7 +2509,7 @@ dependencies = [
[[package]]
name = "rhai_dispatcher"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/rhailib.git#c37be2dfcc447538be8363296b2b465c93ad3e11"
source = "git+https://git.ourworld.tf/herocode/rhailib.git#02d9f5937ea5d5ce78f6f4a89c7400bfd1881057"
dependencies = [
"chrono",
"clap",
@@ -2484,14 +2526,14 @@ dependencies = [
[[package]]
name = "rhailib_dsl"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/rhailib.git#c37be2dfcc447538be8363296b2b465c93ad3e11"
source = "git+https://git.ourworld.tf/herocode/rhailib.git#02d9f5937ea5d5ce78f6f4a89c7400bfd1881057"
dependencies = [
"chrono",
"derive",
"dotenv",
"heromodels 0.1.0 (git+https://git.ourworld.tf/herocode/rhailib.git)",
"heromodels-derive 0.1.0 (git+https://git.ourworld.tf/herocode/rhailib.git)",
"heromodels_core 0.1.0 (git+https://git.ourworld.tf/herocode/rhailib.git)",
"heromodels",
"heromodels-derive",
"heromodels_core",
"macros",
"reqwest",
"rhai",
@@ -2822,6 +2864,15 @@ dependencies = [
"digest",
]
[[package]]
name = "sharded-slab"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
dependencies = [
"lazy_static",
]
[[package]]
name = "shlex"
version = "1.3.0"
@@ -3120,6 +3171,46 @@ dependencies = [
"syn 2.0.104",
]
[[package]]
name = "thread_local"
version = "1.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185"
dependencies = [
"cfg-if",
]
[[package]]
name = "time"
version = "0.3.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40"
dependencies = [
"deranged",
"itoa",
"num-conv",
"powerfmt",
"serde",
"time-core",
"time-macros",
]
[[package]]
name = "time-core"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c"
[[package]]
name = "time-macros"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49"
dependencies = [
"num-conv",
"time-core",
]
[[package]]
name = "tiny-keccak"
version = "2.0.2"
@@ -3335,6 +3426,18 @@ dependencies = [
"tracing-core",
]
[[package]]
name = "tracing-appender"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf"
dependencies = [
"crossbeam-channel",
"thiserror 1.0.69",
"time",
"tracing-subscriber",
]
[[package]]
name = "tracing-attributes"
version = "0.1.30"
@@ -3353,6 +3456,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
dependencies = [
"once_cell",
"valuable",
]
[[package]]
name = "tracing-log"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3"
dependencies = [
"log",
"once_cell",
"tracing-core",
]
[[package]]
name = "tracing-serde"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1"
dependencies = [
"serde",
"tracing-core",
]
[[package]]
name = "tracing-subscriber"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
dependencies = [
"matchers",
"nu-ansi-term",
"once_cell",
"regex",
"serde",
"serde_json",
"sharded-slab",
"smallvec",
"thread_local",
"tracing",
"tracing-core",
"tracing-log",
"tracing-serde",
]
[[package]]
@@ -3366,16 +3512,7 @@ name = "tst"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/db.git#453e86edd24d6009f0b154ac777cc66dc5f3bf76"
dependencies = [
"ourdb 0.1.0 (git+https://git.ourworld.tf/herocode/db.git)",
"thiserror 1.0.69",
]
[[package]]
name = "tst"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/rhailib.git#c37be2dfcc447538be8363296b2b465c93ad3e11"
dependencies = [
"ourdb 0.1.0 (git+https://git.ourworld.tf/herocode/rhailib.git)",
"ourdb",
"thiserror 1.0.69",
]
@@ -3482,6 +3619,12 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "valuable"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
[[package]]
name = "vcpkg"
version = "0.2.15"