Skip to content

Commit

Permalink
ensure stdout/stderr are connected when there are no logging fields
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Apr 4, 2017
1 parent 3ee880b commit c0b4faa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func RunAndWait(c *Command) (int, error) {
}
log.Debugf("%s.RunAndWait start", c.Name)
c.setUpCmd()
if c.logFields == nil {
c.Cmd.Stdout = os.Stdout
c.Cmd.Stderr = os.Stderr
}
log.Debugf("%s.Cmd.Run", c.Name)
if err := c.Cmd.Start(); err != nil {
// the stdlib almost certainly won't include the underlying error
Expand Down

0 comments on commit c0b4faa

Please sign in to comment.