Enhanced Logging (closes #27) #31

Merged
Neshura merged 5 commits from logging into main 2023-12-27 20:31:52 +00:00
Showing only changes of commit 7511828552 - Show all commits

View file

@ -92,7 +92,8 @@ impl ZoneConfig {
let path = confy::get_configuration_file_path(env!("CARGO_PKG_NAME"), "interfaces").expect("Something went wrong with confy");
let zones_dir = path.parent().expect("Something went wrong with confy").join("zones.d/");
let zones = fs::read_dir(zones_dir).unwrap();
let zones = fs::read_dir(zones_dir).expect("Directory creation handling does not yet exist");
let mut zone_configs: Vec<Self> = vec![];
@ -106,7 +107,9 @@ impl ZoneConfig {
false => eprintln!("[WARN] {warn_msg}"),
}
}
else {
else if !path.file_name().expect("Directories should have been filtered out by the leading if")
.to_str().expect("Conversion to str should not fail for a file name")
.starts_with('.') {
let zone_config_path = format!("zones.d/{}", path.file_stem()
.expect("stem could not be extracted from filename").to_str()
.expect("&OsStr could not be converted to &str"));