From 10be989521ef5a5b47cfa4d7b012efa47498df10 Mon Sep 17 00:00:00 2001 From: Nick Cabatoff Date: Fri, 20 Aug 2021 16:26:22 +0200 Subject: [PATCH] Fix `vault debug` so that captured logs include newlines. (#12175) (#12201) --- changelog/12175.txt | 3 +++ command/debug.go | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 changelog/12175.txt diff --git a/changelog/12175.txt b/changelog/12175.txt new file mode 100644 index 0000000000000..a75b21cabd4ab --- /dev/null +++ b/changelog/12175.txt @@ -0,0 +1,3 @@ +```release-note:bug +cli: vault debug now puts newlines after every captured log line. +``` diff --git a/command/debug.go b/command/debug.go index 14b8cbd00f4f7..a3cda921c96f6 100644 --- a/command/debug.go +++ b/command/debug.go @@ -1000,6 +1000,9 @@ func (c *DebugCommand) writeLogs(ctx context.Context) { for { select { case log := <-logCh: + if !strings.HasSuffix(log, "\n") { + log += "\n" + } _, err = out.WriteString(log) if err != nil { c.captureError("log", err)