diff --git a/Cargo.lock b/Cargo.lock index 00be7ef..83d5b87 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1334,6 +1334,16 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + [[package]] name = "tracing-subscriber" version = "0.3.18" @@ -1341,11 +1351,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "nu-ansi-term", + "serde", + "serde_json", "sharded-slab", "smallvec", "thread_local", "tracing-core", "tracing-log", + "tracing-serde", ] [[package]] diff --git a/databases/src/cpu/mod.rs b/databases/src/cpu/mod.rs index 074db37..4c90313 100644 --- a/databases/src/cpu/mod.rs +++ b/databases/src/cpu/mod.rs @@ -162,6 +162,12 @@ impl CpuCache { } } +impl Default for CpuCache { + fn default() -> Self { + Self::new() + } +} + /// Take the input model name, and try to parse it into an [IndexEntry] fn generate_index_entry(name: &str) -> Result> { let model_token = find_model(name); diff --git a/server/Cargo.toml b/server/Cargo.toml index 4fdaf2d..4a8db10 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -15,4 +15,4 @@ clap = { version = "4.5", features = ["derive"] } tokio = { version = "1.40.0", features = ["full"] } tower-http = { version = "0.5.1", features = ["cors", "trace"] } tracing = "0.1.40" -tracing-subscriber = "0.3.18" +tracing-subscriber = { version = "0.3.18", features = ["json"] } diff --git a/server/src/main.rs b/server/src/main.rs index 55f4842..53996bd 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -82,6 +82,7 @@ async fn main() -> Result<(), Box> { // initialize logging let cli_args = Args::parse(); tracing_subscriber::fmt() + .json() .with_span_events(FmtSpan::CLOSE) .init(); // log::set_logger(&LOGGER)