Skip to content

Commit d95a471

Browse files
committed
Add more high level debug logs
1 parent 7b6c81c commit d95a471

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/finder.rs

+16-3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ impl Finder {
7676
{
7777
let path = PathBuf::from(&binary_name);
7878

79+
#[cfg(feature = "tracing")]
80+
tracing::debug!(
81+
"query binary_name = {:?}, paths = {:?}, cwd = {:?}",
82+
binary_name.as_ref().to_string_lossy(),
83+
paths.as_ref().map(|p| p.as_ref().to_string_lossy()),
84+
cwd.as_ref().map(|p| p.as_ref().display())
85+
);
86+
7987
let binary_path_candidates = match cwd {
8088
Some(cwd) if path.has_separator() => {
8189
#[cfg(feature = "tracing")]
@@ -100,10 +108,15 @@ impl Finder {
100108
Either::Right(Self::path_search_candidates(path, paths).into_iter())
101109
}
102110
};
103-
104-
Ok(binary_path_candidates
111+
let ret = binary_path_candidates
105112
.filter(move |p| binary_checker.is_valid(p))
106-
.map(correct_casing))
113+
.map(correct_casing);
114+
#[cfg(feature = "tracing")]
115+
let ret = ret.map(|p| {
116+
tracing::debug!("found path {}", p.display());
117+
p
118+
});
119+
Ok(ret)
107120
}
108121

109122
#[cfg(feature = "regex")]

0 commit comments

Comments
 (0)