mirror of
https://github.com/Llewellynvdm/starship.git
synced 2025-01-27 00:58:37 +00:00
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.
This commit is contained in:
parent
0ef7df4441
commit
05e323da75
@ -141,16 +141,17 @@ pub fn wrap_seq_for_shell(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn internal_exec_cmd(cmd: &str, args: &[&str]) -> Option<CommandOutput> {
|
fn internal_exec_cmd(cmd: &str, args: &[&str]) -> Option<CommandOutput> {
|
||||||
log::trace!("Executing command '{:?}' with args '{:?}'", cmd, args);
|
log::trace!("Executing command {:?} with args {:?}", cmd, args);
|
||||||
match Command::new(cmd).args(args).output() {
|
match Command::new(cmd).args(args).output() {
|
||||||
Ok(output) => {
|
Ok(output) => {
|
||||||
let stdout_string = String::from_utf8(output.stdout).unwrap();
|
let stdout_string = String::from_utf8(output.stdout).unwrap();
|
||||||
let stderr_string = String::from_utf8(output.stderr).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() {
|
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;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user