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