summaryrefslogtreecommitdiff
path: root/src/source_unit.rs
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2025-02-05 14:35:30 +1300
committerBen Bridle <ben@derelict.engineering>2025-02-05 14:35:34 +1300
commit9a0e2154debe1825d54269b4ff888e8edc84d4aa (patch)
tree1dcd4df2a09da9a2ca8dfe33c012475dd77b1625 /src/source_unit.rs
parentbe2ee05119d777209dc764d12b0abdf671238057 (diff)
downloadassembler-9a0e2154debe1825d54269b4ff888e8edc84d4aa.zip
Add logging to gather functions
When gathering source files from paths, log each path traversed or parsed.
Diffstat (limited to 'src/source_unit.rs')
-rw-r--r--src/source_unit.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/source_unit.rs b/src/source_unit.rs
index 69eb436..243b0de 100644
--- a/src/source_unit.rs
+++ b/src/source_unit.rs
@@ -1,5 +1,6 @@
use crate::*;
+use log::info;
use vagabond::*;
@@ -11,6 +12,7 @@ pub fn gather_from_path_variable(variable: &str, extension: Option<&str>, parse:
let mut source_units = Vec::new();
if let Ok(string) = std::env::var(variable) {
for path in string.split(":").map(PathBuf::from) {
+ info!("Found path {path:?} in environment variable {variable:?}");
source_units.extend(gather_from_path(&path, extension, parse));
}
};
@@ -23,12 +25,15 @@ pub fn gather_from_path(path: &Path, extension: Option<&str>, parse: ParseFn) ->
if let Ok(entry) = Entry::from_path(path) {
if EntryType::File == entry.entry_type {
if let Ok(unit) = SourceUnit::from_path(&entry.path, extension, parse) {
+ info!("Found source file at {path:?}");
source_units.push(unit);
}
} else if EntryType::Directory == entry.entry_type {
+ info!("Traversing directory {path:?} for source files");
if let Ok(entries) = traverse_directory(entry.path) {
for entry in entries {
if let Ok(unit) = SourceUnit::from_path(&entry.path, extension, parse) {
+ info!("Found source file at {path:?}");
source_units.push(unit);
}
}