From 8cb57e2f88c5f28341b2612f4eb40a26d3f94595 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Mon, 26 Jun 2023 21:08:48 -0700 Subject: [PATCH] add EXTRA_RUST_LOG helper --- web3_proxy/src/bin/web3_proxy_cli/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web3_proxy/src/bin/web3_proxy_cli/main.rs b/web3_proxy/src/bin/web3_proxy_cli/main.rs index 9844b9cc..b87812b6 100644 --- a/web3_proxy/src/bin/web3_proxy_cli/main.rs +++ b/web3_proxy/src/bin/web3_proxy_cli/main.rs @@ -134,7 +134,7 @@ fn main() -> anyhow::Result<()> { // if RUST_LOG isn't set, configure a default #[cfg(not(feature = "tokio_console"))] - let rust_log = match std::env::var("RUST_LOG") { + let mut rust_log = match std::env::var("RUST_LOG") { Ok(x) => x, Err(_) => match std::env::var("WEB3_PROXY_TRACE").map(|x| x == "true") { Ok(true) => { @@ -170,6 +170,11 @@ fn main() -> anyhow::Result<()> { .join(","), }; + if let Ok(extra_rust_log) = std::env::var("EXTRA_RUST_LOG") { + rust_log.push(','); + rust_log.push_str(&extra_rust_log); + } + let mut cli_config: Web3ProxyCli = argh::from_env(); if cli_config.config.is_none() && cli_config.db_url.is_none() && cli_config.sentry_url.is_none()