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 54444b9d2e
commit ba15b1f822
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 8 deletions

3
changelog/16714.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
debug: Remove extra empty lines from vault.log when debug command is run
```

View File

@ -1080,13 +1080,15 @@ func (c *DebugCommand) writeLogs(ctx context.Context) {
for { for {
select { select {
case log := <-logCh: case log := <-logCh:
if !strings.HasSuffix(log, "\n") { if len(log) > 0 {
log += "\n" if !strings.HasSuffix(log, "\n") {
} log += "\n"
_, err = out.WriteString(log) }
if err != nil { _, err = out.WriteString(log)
c.captureError("log", err) if err != nil {
return c.captureError("log", err)
return
}
} }
case <-ctx.Done(): case <-ctx.Done():
return return

View File

@ -26,7 +26,7 @@ default, this is text.
- `log_level` `(string: "info")` Specifies the log level to use when streaming logs. This defaults to `info` - `log_level` `(string: "info")` Specifies the log level to use when streaming logs. This defaults to `info`
if not specified. if not specified.
- `log_format` `(string: "standard")` Specifies the log format to emit when streaming logs. Supported values are "standard" and "json". The default is `standard`. - `log_format` `(string: "standard")` Specifies the log format to emit when streaming logs. Supported values are "standard" and "json". The default is `standard`,
if not specified. if not specified.
### Sample Request ### Sample Request