Fix `vault debug` so that captured logs include newlines. (#12175)

This commit is contained in:
Nick Cabatoff 2021-07-27 15:15:24 +02:00 committed by GitHub
parent 03b2208f04
commit 6016e86115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

3
changelog/12175.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
cli: vault debug now puts newlines after every captured log line.
```

View File

@ -1000,6 +1000,9 @@ func (c *DebugCommand) writeLogs(ctx context.Context) {
for { for {
select { select {
case log := <-logCh: case log := <-logCh:
if !strings.HasSuffix(log, "\n") {
log += "\n"
}
_, err = out.WriteString(log) _, err = out.WriteString(log)
if err != nil { if err != nil {
c.captureError("log", err) c.captureError("log", err)