Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(log): unhide tracing::instrument from behind feature = "otel" #3873

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = "trace"), skip_all)]
rami3l marked this conversation as resolved.
Show resolved Hide resolved
```

`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 = "trace"))]
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 = "trace"))]
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 = "trace"), 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 = "trace"), 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 = "trace"), 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 = "trace"), 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 = "trace"), 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 = "trace"), skip_all)]
pub(crate) async fn update_extra(
&mut self,
components: &[&str],
Expand Down
Loading