Skip to content

Commit

Permalink
change logging skip for in_test
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettMayson committed Nov 10, 2024
1 parent 1c6b18c commit 82d35d8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ pub fn execute(cli: &Cli) -> Result<(), Error> {
std::process::exit(1);
}

if !cfg!(debug_assertions) && !matches!(cli.command, Some(Commands::Value(_))) {
#[cfg(debug_assertions)]
let in_test = cli.global.in_test;
#[cfg(not(debug_assertions))]
let in_test = false;

if !in_test && !matches!(cli.command, Some(Commands::Value(_))) {
logging::init(
cli.global.verbosity,
!matches!(cli.command, Some(Commands::Utils(_))),
);
}

#[cfg(debug_assertions)]
let in_test = cli.global.in_test;
#[cfg(not(debug_assertions))]
let in_test = false;

#[cfg(debug_assertions)]
if let Some(dir) = &cli.global.dir {
std::env::set_current_dir(dir).expect("Failed to set current directory");
Expand Down

0 comments on commit 82d35d8

Please sign in to comment.