Skip to content

Commit

Permalink
Add more high level debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaeroxe committed Aug 17, 2024
1 parent 7b6c81c commit d95a471
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/finder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ impl Finder {
{
let path = PathBuf::from(&binary_name);

#[cfg(feature = "tracing")]
tracing::debug!(
"query binary_name = {:?}, paths = {:?}, cwd = {:?}",
binary_name.as_ref().to_string_lossy(),
paths.as_ref().map(|p| p.as_ref().to_string_lossy()),
cwd.as_ref().map(|p| p.as_ref().display())
);

let binary_path_candidates = match cwd {
Some(cwd) if path.has_separator() => {
#[cfg(feature = "tracing")]
Expand All @@ -100,10 +108,15 @@ impl Finder {
Either::Right(Self::path_search_candidates(path, paths).into_iter())
}
};

Ok(binary_path_candidates
let ret = binary_path_candidates
.filter(move |p| binary_checker.is_valid(p))
.map(correct_casing))
.map(correct_casing);
#[cfg(feature = "tracing")]
let ret = ret.map(|p| {
tracing::debug!("found path {}", p.display());
p
});
Ok(ret)
}

#[cfg(feature = "regex")]
Expand Down

0 comments on commit d95a471

Please sign in to comment.