diff --git a/Cargo.lock b/Cargo.lock index 0fb6cc04b..a086961f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3390,8 +3390,8 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -4463,6 +4463,15 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "405ba1524a1e6ae755334d6966380c60ec40157e0155f9032dd3c294b6384da9" +[[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 = "matchit" version = "0.5.0" @@ -6221,7 +6230,7 @@ dependencies = [ "rand", "rand_chacha", "rand_xorshift", - "regex-syntax", + "regex-syntax 0.8.4", "rusty-fork", "tempfile", "unarray", @@ -6574,8 +6583,17 @@ checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[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]] @@ -6586,9 +6604,15 @@ checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.4", ] +[[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.4" @@ -9052,12 +9076,16 @@ version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ + "matchers", "nu-ansi-term", + "once_cell", + "regex", "serde", "serde_json", "sharded-slab", "smallvec", "thread_local", + "tracing", "tracing-core", "tracing-log", "tracing-serde", diff --git a/ampd/Cargo.toml b/ampd/Cargo.toml index 2b021a178..3d2ab9fa8 100644 --- a/ampd/Cargo.toml +++ b/ampd/Cargo.toml @@ -74,7 +74,7 @@ toml = "0.5.9" tonic = "0.9.2" tracing = { version = "0.1.37", features = ["valuable", "log"] } tracing-core = { version = "0.1.30", features = ["valuable"] } -tracing-subscriber = { version = "0.3.16", features = ["json", "valuable"] } +tracing-subscriber = { version = "0.3.16", features = ["json", "valuable", "env-filter"] } typed-builder = "0.18.2" url = "2.3.1" valuable = { version = "0.1.0", features = ["derive"] } diff --git a/ampd/src/main.rs b/ampd/src/main.rs index 5e82902e2..be99c01c5 100644 --- a/ampd/src/main.rs +++ b/ampd/src/main.rs @@ -17,6 +17,8 @@ use config::ConfigError; use error_stack::{Report, ResultExt}; use report::LoggableError; use tracing::{error, info}; +use tracing_core::LevelFilter; +use tracing_subscriber::EnvFilter; use valuable::Valuable; #[derive(Debug, Parser, Valuable)] @@ -94,10 +96,25 @@ async fn main() -> ExitCode { fn set_up_logger(output: &Output) { match output { Output::Json => { - tracing_subscriber::fmt().json().flatten_event(true).init(); + tracing_subscriber::fmt() + .json() + .flatten_event(true) + .with_env_filter( + EnvFilter::builder() + .with_default_directive(LevelFilter::INFO.into()) + .from_env_lossy(), + ) + .init(); } Output::Text => { - tracing_subscriber::fmt().compact().init(); + tracing_subscriber::fmt() + .compact() + .with_env_filter( + EnvFilter::builder() + .with_default_directive(LevelFilter::INFO.into()) + .from_env_lossy(), + ) + .init(); } }; }