Skip to content

Commit 18bf8ba

Browse files
committed
feat(log): unhide tracing::instrument from behind feature = "otel"
1 parent bc0acdb commit 18bf8ba

File tree

17 files changed

+36
-36
lines changed

17 files changed

+36
-36
lines changed

doc/dev-guide/src/tracing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ when enabled. Instrumenting a currently uninstrumented function is mostly simply
101101
done like so:
102102

103103
```rust
104-
#[cfg_attr(feature = "otel", tracing::instrument(err, skip_all))]
104+
#[tracing::instrument(level = "trace", err, skip_all)]
105105
```
106106

107107
`skip_all` is not required, but some core structs don't implement Debug yet, and

src/bin/rustup-init.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async fn main() -> Result<ExitCode> {
6161
}
6262
}
6363

64-
#[cfg_attr(feature = "otel", tracing::instrument)]
64+
#[tracing::instrument(level = "trace")]
6565
async fn run_rustup(
6666
process: &Process,
6767
console_filter: Handle<EnvFilter, Registry>,
@@ -76,7 +76,7 @@ async fn run_rustup(
7676
result
7777
}
7878

79-
#[cfg_attr(feature = "otel", tracing::instrument(err))]
79+
#[tracing::instrument(level = "trace", err)]
8080
async fn run_rustup_inner(
8181
process: &Process,
8282
console_filter: Handle<EnvFilter, Registry>,

src/cli/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl Notifier {
177177
}
178178
}
179179

180-
#[cfg_attr(feature = "otel", tracing::instrument)]
180+
#[tracing::instrument(level = "trace")]
181181
pub(crate) fn set_globals(
182182
current_dir: PathBuf,
183183
verbose: bool,

src/cli/proxy_mode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{
99
toolchain::ResolvableLocalToolchainName,
1010
};
1111

12-
#[cfg_attr(feature = "otel", tracing::instrument)]
12+
#[tracing::instrument(level = "trace")]
1313
pub async fn main(arg0: &str, current_dir: PathBuf, process: &Process) -> Result<ExitStatus> {
1414
self_update::cleanup_self_updater(process)?;
1515

src/cli/rustup_mode.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ enum SetSubcmd {
532532
},
533533
}
534534

535-
#[cfg_attr(feature = "otel", tracing::instrument(fields(args = format!("{:?}", process.args_os().collect::<Vec<_>>()))))]
535+
#[tracing::instrument(level = "trace", fields(args = format!("{:?}", process.args_os().collect::<Vec<_>>())))]
536536
pub async fn main(current_dir: PathBuf, process: &Process) -> Result<utils::ExitCode> {
537537
self_update::cleanup_self_updater(process)?;
538538

@@ -907,7 +907,7 @@ async fn which(
907907
Ok(utils::ExitCode(0))
908908
}
909909

910-
#[cfg_attr(feature = "otel", tracing::instrument(skip_all))]
910+
#[tracing::instrument(level = "trace", skip_all)]
911911
fn show(cfg: &Cfg<'_>, verbose: bool) -> Result<utils::ExitCode> {
912912
common::warn_if_host_is_emulated(cfg.process);
913913

@@ -1048,7 +1048,7 @@ fn show(cfg: &Cfg<'_>, verbose: bool) -> Result<utils::ExitCode> {
10481048
Ok(utils::ExitCode(0))
10491049
}
10501050

1051-
#[cfg_attr(feature = "otel", tracing::instrument(skip_all))]
1051+
#[tracing::instrument(level = "trace", skip_all)]
10521052
fn show_active_toolchain(cfg: &Cfg<'_>, verbose: bool) -> Result<utils::ExitCode> {
10531053
match cfg.find_active_toolchain()? {
10541054
Some((toolchain_name, reason)) => {
@@ -1075,7 +1075,7 @@ fn show_active_toolchain(cfg: &Cfg<'_>, verbose: bool) -> Result<utils::ExitCode
10751075
Ok(utils::ExitCode(0))
10761076
}
10771077

1078-
#[cfg_attr(feature = "otel", tracing::instrument(skip_all))]
1078+
#[tracing::instrument(level = "trace", skip_all)]
10791079
fn show_rustup_home(cfg: &Cfg<'_>) -> Result<utils::ExitCode> {
10801080
writeln!(cfg.process.stdout().lock(), "{}", cfg.rustup_dir.display())?;
10811081
Ok(utils::ExitCode(0))

src/cli/self_update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ pub(crate) async fn check_rustup_update(process: &Process) -> Result<()> {
12371237
Ok(())
12381238
}
12391239

1240-
#[cfg_attr(feature = "otel", tracing::instrument)]
1240+
#[tracing::instrument(level = "trace")]
12411241
pub(crate) fn cleanup_self_updater(process: &Process) -> Result<()> {
12421242
let cargo_home = process.cargo_home()?;
12431243
let setup = cargo_home.join(format!("bin/rustup-init{EXE_SUFFIX}"));

src/cli/self_update/windows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ fn has_windows_sdk_libs(process: &Process) -> bool {
362362
}
363363

364364
/// Run by rustup-gc-$num.exe to delete CARGO_HOME
365-
#[cfg_attr(feature = "otel", tracing::instrument)]
365+
#[tracing::instrument(level = "trace")]
366366
pub fn complete_windows_uninstall(process: &Process) -> Result<utils::ExitCode> {
367367
use std::process::Stdio;
368368

src/cli/setup_mode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ struct RustupInit {
7373
dump_testament: bool,
7474
}
7575

76-
#[cfg_attr(feature = "otel", tracing::instrument)]
76+
#[tracing::instrument(level = "trace")]
7777
pub async fn main(
7878
current_dir: PathBuf,
7979
process: &Process,

src/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use anyhow::{Context, Result};
99

1010
use crate::errors::*;
1111

12-
#[cfg_attr(feature = "otel", tracing::instrument(err))]
12+
#[tracing::instrument(level = "trace", err)]
1313
pub(crate) fn run_command_for_dir<S: AsRef<OsStr> + Debug>(
1414
mut cmd: Command,
1515
arg0: &str,

src/config.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ impl<'a> Cfg<'a> {
448448
Ok(self.update_hash_dir.join(toolchain.to_string()))
449449
}
450450

451-
#[cfg_attr(feature = "otel", tracing::instrument(skip_all))]
451+
#[tracing::instrument(level = "trace", skip_all)]
452452
pub(crate) fn upgrade_data(&self) -> Result<()> {
453453
let current_version = self.settings_file.with(|s| Ok(s.version))?;
454454
if current_version == MetadataVersion::default() {
@@ -693,7 +693,7 @@ impl<'a> Cfg<'a> {
693693
}
694694
}
695695

696-
#[cfg_attr(feature = "otel", tracing::instrument)]
696+
#[tracing::instrument(level = "trace")]
697697
pub(crate) async fn active_rustc_version(&mut self) -> Result<String> {
698698
if let Some(t) = self.process.args().find(|x| x.starts_with('+')) {
699699
trace!("Fetching rustc version from toolchain `{}`", t);
@@ -734,7 +734,7 @@ impl<'a> Cfg<'a> {
734734
})
735735
}
736736

737-
#[cfg_attr(feature = "otel", tracing::instrument(skip_all))]
737+
#[tracing::instrument(level = "trace", skip_all)]
738738
async fn find_or_install_active_toolchain(&'a self) -> Result<(Toolchain<'a>, ActiveReason)> {
739739
match self.find_override_config()? {
740740
Some((override_config, reason)) => match override_config {
@@ -839,7 +839,7 @@ impl<'a> Cfg<'a> {
839839
/// - not files
840840
/// - named with a valid resolved toolchain name
841841
/// Currently no notification of incorrect names or entry type is done.
842-
#[cfg_attr(feature = "otel", tracing::instrument(skip_all))]
842+
#[tracing::instrument(level = "trace", skip_all)]
843843
pub(crate) fn list_toolchains(&self) -> Result<Vec<ToolchainName>> {
844844
if utils::is_directory(&self.toolchains_dir) {
845845
let mut toolchains: Vec<_> = utils::read_dir("toolchains", &self.toolchains_dir)?
@@ -921,7 +921,7 @@ impl<'a> Cfg<'a> {
921921
})
922922
}
923923

924-
#[cfg_attr(feature = "otel", tracing::instrument(skip_all))]
924+
#[tracing::instrument(level = "trace", skip_all)]
925925
pub(crate) fn get_default_host_triple(&self) -> Result<dist::TargetTriple> {
926926
self.settings_file
927927
.with(|s| Ok(get_default_host_triple(s, self.process)))

0 commit comments

Comments
 (0)