From 47daab3b67c9bc0a23870ad071bf8b12a531bb64 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Mon, 23 Jan 2023 21:37:23 -0800 Subject: [PATCH] drop log level for backup servers --- web3_proxy/src/app/mod.rs | 2 ++ web3_proxy/src/rpcs/connection.rs | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/web3_proxy/src/app/mod.rs b/web3_proxy/src/app/mod.rs index 0c60ce81..accd2d60 100644 --- a/web3_proxy/src/app/mod.rs +++ b/web3_proxy/src/app/mod.rs @@ -1099,6 +1099,7 @@ impl Web3ProxyApp { | "shh_version") => { // TODO: client error stat // TODO: proper error code + // TODO: right now this sends a warn level log. thats too verbose return Err(anyhow::anyhow!("method unsupported: {}", method)); } // TODO: implement these commands @@ -1109,6 +1110,7 @@ impl Web3ProxyApp { | "eth_newPendingTransactionFilter" | "eth_uninstallFilter") => { // TODO: unsupported command stat + // TODO: right now this sends a warn level log. thats too verbose return Err(anyhow::anyhow!("not yet implemented: {}", method)); } // some commands can use local data or caches diff --git a/web3_proxy/src/rpcs/connection.rs b/web3_proxy/src/rpcs/connection.rs index ea3f9c67..bfb8a9a3 100644 --- a/web3_proxy/src/rpcs/connection.rs +++ b/web3_proxy/src/rpcs/connection.rs @@ -337,7 +337,15 @@ impl Web3Connection { ); let retry_in = Duration::from_millis(sleep_ms); - info!( + + let error_level = if self.backup { + log::Level::Debug + } else { + log::Level::Info + }; + + log::log!( + error_level, "Failed reconnect to {}! Retry in {}ms. err={:?}", self, retry_in.as_millis(),