mirror of
https://codeberg.org/YGGverse/ytd.git
synced 2026-04-08 12:55:32 +00:00
move response to debug level, minor fmt optimizations
This commit is contained in:
parent
f3d69c3ef9
commit
e032a1c93b
1 changed files with 12 additions and 14 deletions
26
src/main.rs
26
src/main.rs
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue