From e880357ab97b10c79d2a545950026222a715d90b Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Mon, 29 Jan 2024 21:16:23 +0100 Subject: [PATCH] chore: add some tracing --- src/artifacts/mod.rs | 5 ++++- src/resolver/mod.rs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/artifacts/mod.rs b/src/artifacts/mod.rs index 2f5a4984..2af62a37 100644 --- a/src/artifacts/mod.rs +++ b/src/artifacts/mod.rs @@ -1440,9 +1440,12 @@ impl Source { } /// Reads the file's content + #[instrument(level = "debug", skip_all, err)] pub fn read(file: impl AsRef) -> Result { let file = file.as_ref(); - Ok(Self::new(fs::read_to_string(file).map_err(|err| SolcIoError::new(err, file))?)) + debug!(file=%file.display()); + let content = fs::read_to_string(file).map_err(|err| SolcIoError::new(err, file))?; + Ok(Self::new(content)) } /// Recursively finds all source files under the given dir path and reads them all diff --git a/src/resolver/mod.rs b/src/resolver/mod.rs index 744c1548..569d339a 100644 --- a/src/resolver/mod.rs +++ b/src/resolver/mod.rs @@ -385,8 +385,8 @@ impl Graph { add_node(&mut unresolved, &mut index, &mut resolved_imports, import) .map_err(|err| { match err { - err @ SolcError::ResolveCaseSensitiveFileName { .. } - | err @ SolcError::Resolve(_) => { + SolcError::ResolveCaseSensitiveFileName { .. } + | SolcError::Resolve(_) => { // make the error more helpful by providing additional // context SolcError::FailedResolveImport(