From 05e323da759d7c631095d97d39fb1596ac37f202 Mon Sep 17 00:00:00 2001 From: Thomas O'Donnell Date: Mon, 13 Apr 2020 15:22:28 +0200 Subject: [PATCH] chore: Add more detailed logging for executing cmds (#1097) This makes some changes to the logging to make debugging what is happening a bit easier when we run external commands. --- src/utils.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index 5fbc4732..c3ec138b 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -141,16 +141,17 @@ pub fn wrap_seq_for_shell( } fn internal_exec_cmd(cmd: &str, args: &[&str]) -> Option { - log::trace!("Executing command '{:?}' with args '{:?}'", cmd, args); + log::trace!("Executing command {:?} with args {:?}", cmd, args); match Command::new(cmd).args(args).output() { Ok(output) => { let stdout_string = String::from_utf8(output.stdout).unwrap(); let stderr_string = String::from_utf8(output.stderr).unwrap(); + log::trace!("stdout: {:?}", stdout_string); + log::trace!("stderr: {:?}", stderr_string); + log::trace!("exit code: \"{:?}\"", output.status.code()); + if !output.status.success() { - log::trace!("Non-zero exit code '{:?}'", output.status.code()); - log::trace!("stdout: {}", stdout_string); - log::trace!("stderr: {}", stderr_string); return None; }