From c3e764dddaed8f794dbe87f624cf356f6a0d7df1 Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Sun, 22 Dec 2024 12:43:42 +0100 Subject: [PATCH] fix: display spans outside debug --- src/download.rs | 2 +- src/linking/mod.rs | 2 +- src/main.rs | 8 ++++---- src/resolver.rs | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/download.rs b/src/download.rs index 659f970..0b6705b 100644 --- a/src/download.rs +++ b/src/download.rs @@ -71,7 +71,7 @@ impl Project { let version_id = version_id.clone(); let node = node.clone(); - let span = tracing::debug_span!( + let span = tracing::info_span!( "download", name = name.to_string(), version_id = version_id.to_string() diff --git a/src/linking/mod.rs b/src/linking/mod.rs index 56bb203..2f3bc00 100644 --- a/src/linking/mod.rs +++ b/src/linking/mod.rs @@ -254,7 +254,7 @@ impl Project { let manifest = manifest.clone(); let package_types = package_types.clone(); - let span = tracing::debug_span!( + let span = tracing::info_span!( "link", name = name.to_string(), version_id = version_id.to_string() diff --git a/src/main.rs b/src/main.rs index e88362b..6f1ff6f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,10 +11,10 @@ use std::{ }; use tempfile::NamedTempFile; use tracing::instrument; -use tracing_indicatif::IndicatifLayer; +use tracing_indicatif::{filter::IndicatifFilter, IndicatifLayer}; use tracing_subscriber::{ filter::LevelFilter, fmt::time::uptime, layer::SubscriberExt, util::SubscriberInitExt, - EnvFilter, + EnvFilter, Layer, }; mod cli; @@ -134,7 +134,7 @@ async fn run() -> anyhow::Result<()> { std::process::exit(status.code().unwrap()); } - let indicatif_layer = IndicatifLayer::new(); + let indicatif_layer = IndicatifLayer::new().with_filter(IndicatifFilter::new(false)); let tracing_env_filter = EnvFilter::builder() .with_default_directive(LevelFilter::INFO.into()) @@ -152,7 +152,7 @@ async fn run() -> anyhow::Result<()> { .with( tracing_subscriber::fmt::layer() .pretty() - .with_writer(indicatif_layer.get_stderr_writer()) + .with_writer(indicatif_layer.inner().get_stderr_writer()) .with_timer(uptime()), ) .with(indicatif_layer) diff --git a/src/resolver.rs b/src/resolver.rs index e7997e5..e85ffac 100644 --- a/src/resolver.rs +++ b/src/resolver.rs @@ -102,7 +102,7 @@ impl Project { continue; }; - let span = tracing::debug_span!("resolve from old graph", alias); + let span = tracing::info_span!("resolve from old graph", alias); let _guard = span.enter(); tracing::debug!("resolved {}@{} from old dependency graph", name, version); @@ -131,7 +131,7 @@ impl Project { while let Some((dep_name, dep_version, path)) = queue.pop_front() { let inner_span = - tracing::debug_span!("resolve dependency", path = path.join(">")); + tracing::info_span!("resolve dependency", path = path.join(">")); let _inner_guard = inner_span.enter(); if let Some(dep_node) = previous_graph .get(dep_name) @@ -399,7 +399,7 @@ impl Project { Ok(()) } - .instrument(tracing::debug_span!("resolve new/changed", path = path.join(">"))) + .instrument(tracing::info_span!("resolve new/changed", path = path.join(">"))) .await?; }