Skip to content

Commit 3cf584b

Browse files
committed
fix logging of actions
1 parent 49b5b92 commit 3cf584b

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/cmd/mod.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -531,23 +531,27 @@ fn log_command(
531531
return future::err(Error::from(CommandError::Timeout(timeout.as_secs())));
532532
}
533533

534+
actions.next_input(&line);
535+
if let Some(f) = &mut process_lines {
536+
f(&line, &mut actions);
537+
}
538+
let lines = actions.take_lines();
539+
534540
if log_output {
535-
info!("[{}] {}", kind.prefix(), line);
541+
for line in &lines {
542+
info!("[{}] {:#?}", kind.prefix(), line);
543+
}
536544
}
537-
future::ok((kind, line))
545+
546+
future::ok((kind, lines))
538547
})
539548
.fold(
540549
(Vec::new(), Vec::new()),
541-
move |mut res, (kind, line)| -> Result<_, Error> {
542-
actions.next_input(&line);
543-
544-
if let Some(f) = &mut process_lines {
545-
f(&line, &mut actions);
546-
}
550+
move |mut res, (kind, mut lines)| -> Result<_, Error> {
547551
if capture {
548552
match kind {
549-
OutputKind::Stdout => res.0.append(&mut actions.take_lines()),
550-
OutputKind::Stderr => res.1.append(&mut actions.take_lines()),
553+
OutputKind::Stdout => res.0.append(&mut lines),
554+
OutputKind::Stderr => res.1.append(&mut lines),
551555
}
552556
}
553557
Ok(res)

0 commit comments

Comments
 (0)