From e032a1c93b31eff198cbfce4aec2e19d42134975 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 7 Apr 2026 14:37:04 +0300 Subject: [PATCH] move response to debug level, minor fmt optimizations --- src/main.rs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2902da1..a7a7bbe 100644 --- a/src/main.rs +++ b/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),