From 9c91f8190dda2c375e63997eab2798388e85d001 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Tue, 2 May 2023 21:11:21 -0700 Subject: [PATCH] tracing: bump a few trace events from DEBUG to INFO Now that we don't print INFO-level events by default, we can start using that level. --- lib/src/git.rs | 12 ++++++------ src/cli_util.rs | 2 +- src/commands/git.rs | 4 ++-- src/merge_tools.rs | 4 ++-- tests/test_global_opts.rs | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/src/git.rs b/lib/src/git.rs index 6ddcc87e3..f65a4338b 100644 --- a/lib/src/git.rs +++ b/lib/src/git.rs @@ -633,14 +633,14 @@ impl<'a> RemoteCallbacks<'a> { let credential_helper = git_config .and_then(|conf| git2::Cred::credential_helper(&conf, url, username_from_url)); if let Ok(creds) = credential_helper { - tracing::debug!("using credential_helper"); + tracing::info!("using credential_helper"); return Ok(creds); } else if let Some(username) = username_from_url { if allowed_types.contains(git2::CredentialType::SSH_KEY) { if std::env::var("SSH_AUTH_SOCK").is_ok() || std::env::var("SSH_AGENT_PID").is_ok() { - tracing::debug!(username, "using ssh_key_from_agent"); + tracing::info!(username, "using ssh_key_from_agent"); return git2::Cred::ssh_key_from_agent(username).map_err(|err| { tracing::error!(err = %err); err @@ -648,7 +648,7 @@ impl<'a> RemoteCallbacks<'a> { } if let Some(ref mut cb) = self.get_ssh_key { if let Some(path) = cb(username) { - tracing::debug!(username, path = ?path, "using ssh_key"); + tracing::info!(username, path = ?path, "using ssh_key"); return git2::Cred::ssh_key(username, None, &path, None).map_err( |err| { tracing::error!(err = %err); @@ -661,7 +661,7 @@ impl<'a> RemoteCallbacks<'a> { if allowed_types.contains(git2::CredentialType::USER_PASS_PLAINTEXT) { if let Some(ref mut cb) = self.get_password { if let Some(pw) = cb(url, username) { - tracing::debug!( + tracing::info!( username, "using userpass_plaintext with username from url" ); @@ -675,7 +675,7 @@ impl<'a> RemoteCallbacks<'a> { } else if allowed_types.contains(git2::CredentialType::USER_PASS_PLAINTEXT) { if let Some(ref mut cb) = self.get_username_password { if let Some((username, pw)) = cb(url) { - tracing::debug!(username, "using userpass_plaintext"); + tracing::info!(username, "using userpass_plaintext"); return git2::Cred::userpass_plaintext(&username, &pw).map_err(|err| { tracing::error!(err = %err); err @@ -683,7 +683,7 @@ impl<'a> RemoteCallbacks<'a> { } } } - tracing::debug!("using default"); + tracing::info!("using default"); git2::Cred::default() }); callbacks diff --git a/src/cli_util.rs b/src/cli_util.rs index 2d62f5fda..0e4bba3a3 100644 --- a/src/cli_util.rs +++ b/src/cli_util.rs @@ -347,7 +347,7 @@ impl TracingSubscription { .map_err(|err| { CommandError::InternalError(format!("failed to enable verbose logging: {err:?}")) })?; - tracing::debug!("verbose logging enabled"); + tracing::info!("verbose logging enabled"); Ok(()) } } diff --git a/src/commands/git.rs b/src/commands/git.rs index 4e335568c..acd17bc2d 100644 --- a/src/commands/git.rs +++ b/src/commands/git.rs @@ -594,10 +594,10 @@ fn get_ssh_key(_username: &str) -> Option { let home_dir = std::env::var("HOME").ok()?; let key_path = std::path::Path::new(&home_dir).join(".ssh").join("id_rsa"); if key_path.is_file() { - tracing::debug!(path = ?key_path, "found ssh key"); + tracing::info!(path = ?key_path, "found ssh key"); Some(key_path) } else { - tracing::debug!(path = ?key_path, "no ssh key found"); + tracing::info!(path = ?key_path, "no ssh key found"); None } } diff --git a/src/merge_tools.rs b/src/merge_tools.rs index ad6746b13..efc6b9b02 100644 --- a/src/merge_tools.rs +++ b/src/merge_tools.rs @@ -239,7 +239,7 @@ pub fn run_mergetool( let mut cmd = Command::new(&editor.program); cmd.args(interpolate_variables(&editor.merge_args, &paths)); - tracing::debug!(?cmd, "Invoking the external merge tool:"); + tracing::info!(?cmd, "Invoking the external merge tool:"); let exit_status = cmd .status() .map_err(|e| ExternalToolError::FailedToExecute { @@ -363,7 +363,7 @@ pub fn edit_diff( }; let mut cmd = Command::new(&editor.program); cmd.args(interpolate_variables(&editor.edit_args, &patterns)); - tracing::debug!(?cmd, "Invoking the external diff editor:"); + tracing::info!(?cmd, "Invoking the external diff editor:"); let exit_status = cmd .status() .map_err(|e| ExternalToolError::FailedToExecute { diff --git a/tests/test_global_opts.rs b/tests/test_global_opts.rs index 3a384ef3e..80a904294 100644 --- a/tests/test_global_opts.rs +++ b/tests/test_global_opts.rs @@ -444,5 +444,5 @@ fn test_verbose_logging_enabled() { .split_at(36); // The log format is currently Pretty so we include the terminal markup. // Luckily, insta will print this in colour when reviewing. - insta::assert_snapshot!(log_line, @"DEBUG jujutsu::cli_util: verbose logging enabled"); + insta::assert_snapshot!(log_line, @" INFO jujutsu::cli_util: verbose logging enabled"); }