Remove extra empty lines from vault.log - Debug command (#16714)

* debug empty lines in vault.log

* minor grammar fix

* add changelog

* add fmt changes
This commit is contained in:
akshya96
2022-08-15 14:16:57 -07:00
committed by GitHub
parent 241947dd33
commit 02dbcb6bce
3 changed files with 13 additions and 8 deletions

View File

@@ -1080,13 +1080,15 @@ 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)
return
if len(log) > 0 {
if !strings.HasSuffix(log, "\n") {
log += "\n"
}
_, err = out.WriteString(log)
if err != nil {
c.captureError("log", err)
return
}
}
case <-ctx.Done():
return