mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-06-30 14:08:30 -07:00
improve basic logging
This commit is contained in:
committed by
Will Greenberg
parent
2702ee0828
commit
f5a0cddc88
@@ -26,10 +26,15 @@ impl Command<'_> {
|
||||
// by subcommand_modifiers()
|
||||
subcommands: modifiers::subcommand_modifiers()
|
||||
.iter()
|
||||
.filter_map(|modifier| {
|
||||
subcommand_map
|
||||
.get(modifier.command)
|
||||
.map(|subcommand| Subcommand::new(subcommand, modifier))
|
||||
.filter_map(|modifier| match subcommand_map.get(modifier.command) {
|
||||
Some(clap_command) => Some(Subcommand::new(clap_command, modifier)),
|
||||
None => {
|
||||
error!(
|
||||
"failed to find clap command for subcommand {}",
|
||||
modifier.command
|
||||
);
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect(),
|
||||
}
|
||||
@@ -90,13 +95,16 @@ impl Subcommand<'_> {
|
||||
.iter()
|
||||
.filter_map(|arg_modifier| {
|
||||
let Some(arg) = argument_map.get(arg_modifier.clap_id) else {
|
||||
error!("failed to get argument with id {arg_modifier.clap_id}");
|
||||
error!(
|
||||
"failed to find clap argument with id {}",
|
||||
arg_modifier.clap_id
|
||||
);
|
||||
return None;
|
||||
};
|
||||
match Argument::try_new(arg, arg_modifier) {
|
||||
Ok(modified_arg) => Some(modified_arg),
|
||||
Err(err) => {
|
||||
error!("failed to modify arg: {err:?}");
|
||||
error!("failed to create modified argument: {:?}", err);
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user