From 93ab6ad9226f8868e0a6a9a7ea4176efdae86eac Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Mon, 11 Nov 2024 15:11:20 +0100 Subject: [PATCH] logs: Reduce log noise by using more debug logs (#20498) Release Notes: - N/A --- crates/assistant/src/prompts.rs | 4 ++-- crates/client/src/client.rs | 8 ++++---- crates/reqwest_client/src/reqwest_client.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/assistant/src/prompts.rs b/crates/assistant/src/prompts.rs index 4d6d7ea3df..131b908feb 100644 --- a/crates/assistant/src/prompts.rs +++ b/crates/assistant/src/prompts.rs @@ -149,7 +149,7 @@ impl PromptBuilder { if file_path.to_string_lossy().ends_with(".hbs") { if let Ok(content) = params.fs.load(&file_path).await { let file_name = file_path.file_stem().unwrap().to_string_lossy(); - log::info!("Registering prompt template override: {}", file_name); + log::debug!("Registering prompt template override: {}", file_name); handlebars.lock().register_template_string(&file_name, content).log_err(); } } @@ -194,7 +194,7 @@ impl PromptBuilder { for path in Assets.list("prompts")? { if let Some(id) = path.split('/').last().and_then(|s| s.strip_suffix(".hbs")) { if let Some(prompt) = Assets.load(path.as_ref()).log_err().flatten() { - log::info!("Registering built-in prompt template: {}", id); + log::debug!("Registering built-in prompt template: {}", id); let prompt = String::from_utf8_lossy(prompt.as_ref()); handlebars.register_template_string(id, LineEnding::normalize_cow(prompt))? } diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs index b145ef99d0..1e73c7be66 100644 --- a/crates/client/src/client.rs +++ b/crates/client/src/client.rs @@ -889,7 +889,7 @@ impl Client { cx: &AsyncAppContext, ) -> Result<()> { let executor = cx.background_executor(); - log::info!("add connection to peer"); + log::debug!("add connection to peer"); let (connection_id, handle_io, mut incoming) = self.peer.add_connection(conn, { let executor = executor.clone(); move |duration| executor.timer(duration) @@ -897,12 +897,12 @@ impl Client { let handle_io = executor.spawn(handle_io); let peer_id = async { - log::info!("waiting for server hello"); + log::debug!("waiting for server hello"); let message = incoming .next() .await .ok_or_else(|| anyhow!("no hello message received"))?; - log::info!("got server hello"); + log::debug!("got server hello"); let hello_message_type_name = message.payload_type_name().to_string(); let hello = message .into_any() @@ -928,7 +928,7 @@ impl Client { } }; - log::info!( + log::debug!( "set status to connected (connection id: {:?}, peer id: {:?})", connection_id, peer_id diff --git a/crates/reqwest_client/src/reqwest_client.rs b/crates/reqwest_client/src/reqwest_client.rs index 08054a0128..9f43aa44e7 100644 --- a/crates/reqwest_client/src/reqwest_client.rs +++ b/crates/reqwest_client/src/reqwest_client.rs @@ -61,7 +61,7 @@ impl ReqwestClient { impl From for ReqwestClient { fn from(client: reqwest::Client) -> Self { let handle = tokio::runtime::Handle::try_current().unwrap_or_else(|_| { - log::info!("no tokio runtime found, creating one for Reqwest..."); + log::debug!("no tokio runtime found, creating one for Reqwest..."); let runtime = RUNTIME.get_or_init(|| { tokio::runtime::Builder::new_multi_thread() // Since we now have two executors, let's try to keep our footprint small