Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Silence a bucketload of logs (#36534)

Conrad Irwincac80e2ebde4
diff --git a/crates/agent2/src/tools/terminal_tool.rs b/crates/agent2/src/tools/terminal_tool.rs
index d8f0282f4bd..17e671fba3d 100644
--- a/crates/agent2/src/tools/terminal_tool.rs
+++ b/crates/agent2/src/tools/terminal_tool.rs
@@ -47,12 +47,9 @@ impl TerminalTool {
}
if which::which("bash").is_ok() {
- log::info!("agent selected bash for terminal tool");
"bash".into()
} else {
- let shell = get_system_shell();
- log::info!("agent selected {shell} for terminal tool");
- shell
+ get_system_shell()
}
});
Self {
diff --git a/crates/assistant_context/src/context_store.rs b/crates/assistant_context/src/context_store.rs
index 6d13531a57d..c5b5e99a527 100644
--- a/crates/assistant_context/src/context_store.rs
+++ b/crates/assistant_context/src/context_store.rs
@@ -905,7 +905,7 @@ impl ContextStore {
.into_iter()
.filter(assistant_slash_commands::acceptable_prompt)
.map(|prompt| {
- log::info!("registering context server command: {:?}", prompt.name);
+ log::debug!("registering context server command: {:?}", prompt.name);
slash_command_working_set.insert(Arc::new(
assistant_slash_commands::ContextServerSlashCommand::new(
context_server_store.clone(),
diff --git a/crates/assistant_tools/src/terminal_tool.rs b/crates/assistant_tools/src/terminal_tool.rs
index 14bbcef8b4c..358d62ee1a5 100644
--- a/crates/assistant_tools/src/terminal_tool.rs
+++ b/crates/assistant_tools/src/terminal_tool.rs
@@ -59,12 +59,9 @@ impl TerminalTool {
}
if which::which("bash").is_ok() {
- log::info!("agent selected bash for terminal tool");
"bash".into()
} else {
- let shell = get_system_shell();
- log::info!("agent selected {shell} for terminal tool");
- shell
+ get_system_shell()
}
});
Self {
diff --git a/crates/context_server/src/client.rs b/crates/context_server/src/client.rs
index 609d2c43e36..ccf7622d82f 100644
--- a/crates/context_server/src/client.rs
+++ b/crates/context_server/src/client.rs
@@ -161,7 +161,7 @@ impl Client {
working_directory: &Option<PathBuf>,
cx: AsyncApp,
) -> Result<Self> {
- log::info!(
+ log::debug!(
"starting context server (executable={:?}, args={:?})",
binary.executable,
&binary.args
@@ -295,7 +295,7 @@ impl Client {
/// Continuously reads and logs any error messages from the server.
async fn handle_err(transport: Arc<dyn Transport>) -> anyhow::Result<()> {
while let Some(err) = transport.receive_err().next().await {
- log::warn!("context server stderr: {}", err.trim());
+ log::debug!("context server stderr: {}", err.trim());
}
Ok(())
diff --git a/crates/context_server/src/context_server.rs b/crates/context_server/src/context_server.rs
index 34fa29678d5..9ca78138dbc 100644
--- a/crates/context_server/src/context_server.rs
+++ b/crates/context_server/src/context_server.rs
@@ -137,7 +137,7 @@ impl ContextServer {
}
async fn initialize(&self, client: Client) -> Result<()> {
- log::info!("starting context server {}", self.id);
+ log::debug!("starting context server {}", self.id);
let protocol = crate::protocol::ModelContextProtocol::new(client);
let client_info = types::Implementation {
name: "Zed".to_string(),
diff --git a/crates/db/src/db.rs b/crates/db/src/db.rs
index 37e347282d0..8b790cbec84 100644
--- a/crates/db/src/db.rs
+++ b/crates/db/src/db.rs
@@ -74,7 +74,7 @@ pub async fn open_db<M: Migrator + 'static>(db_dir: &Path, scope: &str) -> Threa
}
async fn open_main_db<M: Migrator>(db_path: &Path) -> Option<ThreadSafeConnection> {
- log::info!("Opening database {}", db_path.display());
+ log::trace!("Opening database {}", db_path.display());
ThreadSafeConnection::builder::<M>(db_path.to_string_lossy().as_ref(), true)
.with_db_initialization_query(DB_INITIALIZE_QUERY)
.with_connection_initialize_query(CONNECTION_INITIALIZE_QUERY)
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index f943e64923b..575631b5176 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -16606,10 +16606,7 @@ impl Editor {
.transaction(transaction_id_prev)
.map(|t| t.0.clone())
})
- .unwrap_or_else(|| {
- log::info!("Failed to determine selections from before format. Falling back to selections when format was initiated");
- self.selections.disjoint_anchors()
- });
+ .unwrap_or_else(|| self.selections.disjoint_anchors());
let mut timeout = cx.background_executor().timer(FORMAT_TIMEOUT).fuse();
let format = project.update(cx, |project, cx| {
diff --git a/crates/gpui/src/arena.rs b/crates/gpui/src/arena.rs
index ee72d0e9642..0983bd23454 100644
--- a/crates/gpui/src/arena.rs
+++ b/crates/gpui/src/arena.rs
@@ -142,7 +142,7 @@ impl Arena {
if self.current_chunk_index >= self.chunks.len() {
self.chunks.push(Chunk::new(self.chunk_size));
assert_eq!(self.current_chunk_index, self.chunks.len() - 1);
- log::info!(
+ log::trace!(
"increased element arena capacity to {}kb",
self.capacity() / 1024,
);
diff --git a/crates/language/src/language.rs b/crates/language/src/language.rs
index b70e4662465..87fc846a537 100644
--- a/crates/language/src/language.rs
+++ b/crates/language/src/language.rs
@@ -331,7 +331,7 @@ pub trait LspAdapter: 'static + Send + Sync {
// for each worktree we might have open.
if binary_options.allow_path_lookup
&& let Some(binary) = self.check_if_user_installed(delegate.as_ref(), toolchains, cx).await {
- log::info!(
+ log::debug!(
"found user-installed language server for {}. path: {:?}, arguments: {:?}",
self.name().0,
binary.path,
@@ -601,7 +601,7 @@ async fn try_fetch_server_binary<L: LspAdapter + 'static + Send + Sync + ?Sized>
}
let name = adapter.name();
- log::info!("fetching latest version of language server {:?}", name.0);
+ log::debug!("fetching latest version of language server {:?}", name.0);
delegate.update_status(name.clone(), BinaryStatus::CheckingForUpdate);
let latest_version = adapter
@@ -612,7 +612,7 @@ async fn try_fetch_server_binary<L: LspAdapter + 'static + Send + Sync + ?Sized>
.check_if_version_installed(latest_version.as_ref(), &container_dir, delegate.as_ref())
.await
{
- log::info!("language server {:?} is already installed", name.0);
+ log::debug!("language server {:?} is already installed", name.0);
delegate.update_status(name.clone(), BinaryStatus::None);
Ok(binary)
} else {
diff --git a/crates/project/src/context_server_store.rs b/crates/project/src/context_server_store.rs
index 16625caeb4b..e826f44b7b0 100644
--- a/crates/project/src/context_server_store.rs
+++ b/crates/project/src/context_server_store.rs
@@ -399,7 +399,6 @@ impl ContextServerStore {
async move |this, cx| {
match server.clone().start(cx).await {
Ok(_) => {
- log::info!("Started {} context server", id);
debug_assert!(server.client().is_some());
this.update(cx, |this, cx| {
diff --git a/crates/project/src/context_server_store/extension.rs b/crates/project/src/context_server_store/extension.rs
index 1eb0fe7da12..2a3a0c2e4b9 100644
--- a/crates/project/src/context_server_store/extension.rs
+++ b/crates/project/src/context_server_store/extension.rs
@@ -63,7 +63,7 @@ impl registry::ContextServerDescriptor for ContextServerDescriptor {
.await?;
command.command = extension.path_from_extension(&command.command);
- log::info!("loaded command for context server {id}: {command:?}");
+ log::debug!("loaded command for context server {id}: {command:?}");
Ok(ContextServerCommand {
path: command.command,
diff --git a/crates/project/src/debugger/breakpoint_store.rs b/crates/project/src/debugger/breakpoint_store.rs
index 38d8b4cfc65..00fcc7e69fc 100644
--- a/crates/project/src/debugger/breakpoint_store.rs
+++ b/crates/project/src/debugger/breakpoint_store.rs
@@ -831,7 +831,6 @@ impl BreakpointStore {
new_breakpoints.insert(path, breakpoints_for_file);
}
this.update(cx, |this, cx| {
- log::info!("Finish deserializing breakpoints & initializing breakpoint store");
for (path, count) in new_breakpoints.iter().map(|(path, bp_in_file)| {
(path.to_string_lossy(), bp_in_file.breakpoints.len())
}) {
diff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rs
index a8c6ffd8785..d2fb12ee372 100644
--- a/crates/project/src/lsp_store.rs
+++ b/crates/project/src/lsp_store.rs
@@ -296,7 +296,7 @@ impl LocalLspStore {
let stderr_capture = Arc::new(Mutex::new(Some(String::new())));
let server_id = self.languages.next_language_server_id();
- log::info!(
+ log::trace!(
"attempting to start language server {:?}, path: {root_path:?}, id: {server_id}",
adapter.name.0
);
@@ -7529,7 +7529,7 @@ impl LspStore {
.ok()
.flatten()?;
- log::info!("Refreshing workspace configurations for servers {refreshed_servers:?}");
+ log::debug!("Refreshing workspace configurations for servers {refreshed_servers:?}");
// TODO this asynchronous job runs concurrently with extension (de)registration and may take enough time for a certain extension
// to stop and unregister its language server wrapper.
// This is racy : an extension might have already removed all `local.language_servers` state, but here we `.clone()` and hold onto it anyway.
diff --git a/crates/prompt_store/src/prompts.rs b/crates/prompt_store/src/prompts.rs
index cd34bafb20a..4ab867ab644 100644
--- a/crates/prompt_store/src/prompts.rs
+++ b/crates/prompt_store/src/prompts.rs
@@ -229,12 +229,12 @@ impl PromptBuilder {
log_message.push_str(" -> ");
log_message.push_str(&target.display().to_string());
}
- log::info!("{}.", log_message);
+ log::trace!("{}.", log_message);
} else {
if !found_dir_once {
- log::info!("No prompt template overrides directory found at {}. Using built-in prompts.", templates_dir.display());
+ log::trace!("No prompt template overrides directory found at {}. Using built-in prompts.", templates_dir.display());
if let Some(target) = symlink_status {
- log::info!("Symlink found pointing to {}, but target is invalid.", target.display());
+ log::trace!("Symlink found pointing to {}, but target is invalid.", target.display());
}
}
@@ -247,7 +247,7 @@ impl PromptBuilder {
log_message.push_str(" -> ");
log_message.push_str(&target.display().to_string());
}
- log::info!("{}.", log_message);
+ log::trace!("{}.", log_message);
break;
}
}
diff --git a/crates/rpc/src/peer.rs b/crates/rpc/src/peer.rs
index 8b77788d226..98f5fa40e96 100644
--- a/crates/rpc/src/peer.rs
+++ b/crates/rpc/src/peer.rs
@@ -26,7 +26,6 @@ use std::{
time::Duration,
time::Instant,
};
-use tracing::instrument;
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Serialize)]
pub struct ConnectionId {
@@ -109,7 +108,6 @@ impl Peer {
self.epoch.load(SeqCst)
}
- #[instrument(skip_all)]
pub fn add_connection<F, Fut, Out>(
self: &Arc<Self>,
connection: Connection,
diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs
index 8c1be61abfc..d64a4472a07 100644
--- a/crates/workspace/src/workspace.rs
+++ b/crates/workspace/src/workspace.rs
@@ -2503,8 +2503,6 @@ impl Workspace {
window: &mut Window,
cx: &mut Context<Self>,
) -> Task<Vec<Option<anyhow::Result<Box<dyn ItemHandle>>>>> {
- log::info!("open paths {abs_paths:?}");
-
let fs = self.app_state.fs.clone();
// Sort the paths to ensure we add worktrees for parents before their children.
diff --git a/crates/zeta/src/license_detection.rs b/crates/zeta/src/license_detection.rs
index 3dd025c1e15..022b2d19de4 100644
--- a/crates/zeta/src/license_detection.rs
+++ b/crates/zeta/src/license_detection.rs
@@ -143,10 +143,10 @@ impl LicenseDetectionWatcher {
}
async fn is_path_eligible(fs: &Arc<dyn Fs>, abs_path: PathBuf) -> Option<bool> {
- log::info!("checking if `{abs_path:?}` is an open source license");
+ log::debug!("checking if `{abs_path:?}` is an open source license");
// Resolve symlinks so that the file size from metadata is correct.
let Some(abs_path) = fs.canonicalize(&abs_path).await.ok() else {
- log::info!(
+ log::debug!(
"`{abs_path:?}` license file probably deleted (error canonicalizing the path)"
);
return None;
@@ -159,11 +159,11 @@ impl LicenseDetectionWatcher {
let text = fs.load(&abs_path).await.log_err()?;
let is_eligible = is_license_eligible_for_data_collection(&text);
if is_eligible {
- log::info!(
+ log::debug!(
"`{abs_path:?}` matches a license that is eligible for data collection (if enabled)"
);
} else {
- log::info!(
+ log::debug!(
"`{abs_path:?}` does not match a license that is eligible for data collection"
);
}