Skip to content

Commit

Permalink
chore: print resolve options while debug tracing
Browse files Browse the repository at this point in the history
It is hard to find the matching options when there are lots of options
  • Loading branch information
Boshen committed Apr 22, 2024
1 parent ee22b66 commit 0256f6e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,14 @@ impl<Fs: FileSystem> ResolverGeneric<Fs> {
) -> Result<Resolution, ResolveError> {
let span = tracing::debug_span!("resolve", path = ?path, specifier = specifier);
let _enter = span.enter();
tracing::trace!(options = ?self.options, "resolve_options");
let r = self.resolve_impl(path, specifier, ctx);
match &r {
Ok(r) => tracing::debug!(path = ?path, specifier = specifier, ret = ?r.path),
Err(err) => tracing::debug!(path = ?path, specifier = specifier, err = ?err),
Ok(r) => {
tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, ret = ?r.path)
}
Err(err) => {
tracing::debug!(options = ?self.options, path = ?path, specifier = specifier, err = ?err)
}
};
r
}
Expand Down

0 comments on commit 0256f6e

Please sign in to comment.