move response to debug level, minor fmt optimizations

This commit is contained in:
yggverse 2026-04-07 14:37:04 +03:00
parent f3d69c3ef9
commit e032a1c93b

View file

@ -125,10 +125,12 @@ async fn main() {
})
}) {
match database.process(&item.id) {
Ok(()) => info!(
"exec `{cmd}` for channel `{c}` successful: `{:?}`",
response
),
Ok(()) => {
info!(
"exec `{cmd}` for channel `{c}` successful."
);
debug!("stdout: `{response:?}`");
}
Err(e) => panic!(
"can't persist processed item `{}` for channel `{c}` by `{cmd}`: `{e}`",
item.id
@ -136,14 +138,12 @@ async fn main() {
}
} else {
warn!(
"unexpected exec result `{cmd}` for channel `{c}`: `{:?}`",
response
"unexpected exec result `{cmd}` for channel `{c}`: `{response:?}`"
)
}
} else {
warn!(
"exec `{cmd}` for channel `{c}` failed: `{:?}`",
response
"exec `{cmd}` for channel `{c}` failed: `{response:?}`",
)
}
}
@ -189,15 +189,13 @@ fn cmd(command: &config::Command) {
v.iter()
.all(|s| String::from_utf8_lossy(&response.stdout).contains(s))
}) {
info!("exec `{}` successful: `{:?}`", command.exec, response)
info!("exec `{}` successful.", command.exec);
debug!("stdout: `{response:?}`");
} else {
panic!(
"unexpected exec result `{}`: `{:?}`",
command.exec, response
)
panic!("unexpected exec result `{}`: `{response:?}`", command.exec)
}
} else {
panic!("exec `{}` failed: `{:?}`", command.exec, response)
panic!("exec `{}` failed: `{response:?}`", command.exec)
}
}
Err(e) => panic!("can't execute `{}`: `{e}`", command.exec),