Skip to content

Commit

Permalink
Merge pull request #984 from jpeach/fix-shell-log-format
Browse files Browse the repository at this point in the history
Fix shell output log formatting.
  • Loading branch information
brikis98 authored Sep 8, 2021
2 parents c66f280 + 9b2f5ad commit c00bbe0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/shell/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,14 @@ func readData(t testing.TestingT, log *logger.Logger, reader *bufio.Reader, writ
break
}

log.Logf(t, line)
// logger.Logger has a Logf method, but not a Log method.
// We have to use the format string indirection to avoid
// interpreting any possible formatting characters in
// the line.
//
// See https://github.com/gruntwork-io/terratest/issues/982.
log.Logf(t, "%s", line)

if _, err := writer.WriteString(line); err != nil {
return err
}
Expand Down

0 comments on commit c00bbe0

Please sign in to comment.