Skip to content

Commit

Permalink
feat(log): set level of #[tracing::instrument(err)] to DEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed Jul 10, 2024
1 parent 2ede7f7 commit d4a5997
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion doc/dev-guide/src/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ when enabled. Instrumenting a currently uninstrumented function is mostly simply
done like so:

```rust
#[tracing::instrument(level = "trace", err, skip_all)]
#[tracing::instrument(level = "trace", err(level = "debug"), skip_all)]
```

`skip_all` is not required, but some core structs don't implement Debug yet, and
Expand Down
2 changes: 1 addition & 1 deletion src/bin/rustup-init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async fn run_rustup(
result
}

#[tracing::instrument(level = "trace", err)]
#[tracing::instrument(level = "trace", err(level = "debug"))]
async fn run_rustup_inner(
process: &Process,
console_filter: Handle<EnvFilter, Registry>,
Expand Down
2 changes: 1 addition & 1 deletion src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use anyhow::{Context, Result};

use crate::errors::*;

#[tracing::instrument(level = "trace", err)]
#[tracing::instrument(level = "trace", err(level = "debug"))]
pub(crate) fn run_command_for_dir<S: AsRef<OsStr> + Debug>(
mut cmd: Command,
arg0: &str,
Expand Down
2 changes: 1 addition & 1 deletion src/dist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ pub(crate) struct DistOptions<'a> {
// an upgrade then all the existing components will be upgraded.
//
// Returns the manifest's hash if anything changed.
#[tracing::instrument(level = "trace", err, skip_all, fields(profile=format!("{:?}", opts.profile), prefix=prefix.path().to_string_lossy().to_string()))]
#[tracing::instrument(level = "trace", err(level = "debug"), skip_all, fields(profile=format!("{:?}", opts.profile), prefix=prefix.path().to_string_lossy().to_string()))]
pub(crate) async fn update_from_dist(
prefix: &InstallPrefix,
opts: &DistOptions<'_>,
Expand Down
2 changes: 1 addition & 1 deletion src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub(crate) enum InstallMethod<'a> {

impl<'a> InstallMethod<'a> {
// Install a toolchain
#[tracing::instrument(level = "trace", err, skip_all)]
#[tracing::instrument(level = "trace", err(level = "debug"), skip_all)]
pub(crate) async fn install(&self) -> Result<UpdateStatus> {
let nh = &self.cfg().notify_handler;
match self {
Expand Down
8 changes: 4 additions & 4 deletions src/toolchain/distributable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ impl<'a> DistributableToolchain<'a> {
InstallPrefix::from(self.toolchain.path().to_owned()).guess_v1_manifest()
}

#[tracing::instrument(level = "trace", err, skip_all)]
#[tracing::instrument(level = "trace", err(level = "debug"), skip_all)]
pub(crate) async fn install(
cfg: &'a Cfg<'a>,
toolchain: &ToolchainDesc,
Expand Down Expand Up @@ -354,7 +354,7 @@ impl<'a> DistributableToolchain<'a> {
Ok((status, Self::new(cfg, toolchain.clone())?))
}

#[tracing::instrument(level = "trace", err, skip_all)]
#[tracing::instrument(level = "trace", err(level = "debug"), skip_all)]
pub async fn install_if_not_installed(
cfg: &'a Cfg<'a>,
desc: &ToolchainDesc,
Expand All @@ -372,7 +372,7 @@ impl<'a> DistributableToolchain<'a> {
}
}

#[tracing::instrument(level = "trace", err, skip_all)]
#[tracing::instrument(level = "trace", err(level = "debug"), skip_all)]
pub(crate) async fn update(
&mut self,
components: &[&str],
Expand All @@ -384,7 +384,7 @@ impl<'a> DistributableToolchain<'a> {
}

/// Update a toolchain with control over the channel behaviour
#[tracing::instrument(level = "trace", err, skip_all)]
#[tracing::instrument(level = "trace", err(level = "debug"), skip_all)]
pub(crate) async fn update_extra(
&mut self,
components: &[&str],
Expand Down

0 comments on commit d4a5997

Please sign in to comment.