Skip to content

Commit 06cbf71

Browse files
committed
Remove duplicated command log
Before, we printed the command twice with trace logging, which was spammy in logs.
1 parent 9a9d5fc commit 06cbf71

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

collector/src/compile/execute/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,6 @@ impl<'a> CargoProcess<'a> {
446446
client.configure(&mut cmd);
447447
}
448448

449-
log::debug!("{:?}", cmd);
450-
451449
let cmd = tokio::process::Command::from(cmd);
452450
let output = async_command_output(cmd).await?;
453451

collector/src/lib.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -249,23 +249,18 @@ pub async fn async_command_output(
249249
) -> anyhow::Result<process::Output> {
250250
use anyhow::Context;
251251

252+
log::debug!("Executing {:?}", cmd);
253+
252254
let start = Instant::now();
253255
let child = cmd
254256
.stdout(Stdio::piped())
255257
.stderr(Stdio::piped())
256258
.spawn()
257259
.with_context(|| format!("failed to spawn process for cmd: {:?}", cmd))?;
258260
let output = child.wait_with_output().await?;
259-
log::trace!("command {cmd:?} took {} ms", start.elapsed().as_millis());
261+
log::trace!("Command took {} ms", start.elapsed().as_millis());
260262

261-
if !output.status.success() {
262-
return Err(anyhow::anyhow!(
263-
"expected success, got {}\n\nstderr={}\n\n stdout={}\n",
264-
output.status,
265-
String::from_utf8_lossy(&output.stderr),
266-
String::from_utf8_lossy(&output.stdout)
267-
));
268-
}
263+
check_command_output(&output)?;
269264

270265
Ok(output)
271266
}

0 commit comments

Comments
 (0)