Skip to content

Commit

Permalink
fixed filter for indicatif_layer
Browse files Browse the repository at this point in the history
  • Loading branch information
FroVolod committed Sep 23, 2024
1 parent 33a03cd commit 6d08a16
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions cargo-near/src/commands/new/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ pub struct New {
pub struct NewContext;

impl NewContext {
#[tracing::instrument(name = "Creating a new project:", skip_all)]
#[tracing::instrument(
target = "tracing_instrument",
name = "Creating a new project:",
skip_all
)]
pub fn from_previous_context(
_previous_context: near_cli_rs::GlobalContext,
scope: &<New as interactive_clap::ToInteractiveClapContextScope>::InteractiveClapContextScope,
Expand Down Expand Up @@ -75,14 +79,18 @@ impl NewContext {
}
}

#[tracing::instrument(name = "Sending a tracking request ...")]
#[tracing::instrument(target = "tracing_instrument", name = "Sending a tracking request ...")]
fn track_request() {
let _detached_thread_handle = std::thread::Builder::new()
.spawn(mixpanel_tracking::track_usage)
.unwrap();
}

#[tracing::instrument(name = "The process of executing", skip_all)]
#[tracing::instrument(
target = "tracing_instrument",
name = "The process of executing",
skip_all
)]
fn execute_git_commands(project_dir: &std::path::Path) -> near_cli_rs::CliResult {
tracing::Span::current().pb_set_message("`git` commands ...");
tracing::info!(target: "near_teach_me", "`git init`");
Expand Down
2 changes: 1 addition & 1 deletion cargo-near/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn main() -> CliResult {
let env_filter = EnvFilter::from_default_env()
.add_directive(tracing::Level::WARN.into())
.add_directive("near_cli_rs=info".parse()?)
.add_directive("cargo_near=info".parse()?);
.add_directive("tracing_instrument=info".parse()?);
tracing_subscriber::registry()
.with(
tracing_subscriber::fmt::layer()
Expand Down

0 comments on commit 6d08a16

Please sign in to comment.