feat(cli): Log the policy

This is in part to help in cases like #487 but it will also help people
generally configure and debug their config.
This commit is contained in:
Ed Page 2022-05-16 09:06:22 -05:00
parent 778fd7a53d
commit a17f6a284a

View file

@ -313,8 +313,18 @@ impl DirConfig {
.and_then(|g| g.file_type_def()) .and_then(|g| g.file_type_def())
.map(|f| f.name()); .map(|f| f.name());
name.and_then(|name| self.types.get(name).copied()) name.and_then(|name| {
.unwrap_or(self.default) log::debug!("{}: `{}` policy", path.display(), name);
self.types.get(name).copied()
})
.unwrap_or_else(|| {
log::debug!(
"{}: default policy for `{}` file type",
path.display(),
name.unwrap_or("<unknown>")
);
self.default
})
} }
} }