Browse Source

Fix extra space printed with `--no-log-prefix` option

Signed-off-by: Jan Vitturi <[email protected]>
Jan Vitturi 3 years ago
parent
commit
84f2168f80
1 changed files with 2 additions and 2 deletions
  1. 2 2
      cmd/formatter/logs.go

+ 2 - 2
cmd/formatter/logs.go

@@ -79,7 +79,7 @@ func (l *logConsumer) Log(container, service, message string) {
 	}
 	p := l.getPresenter(container)
 	for _, line := range strings.Split(message, "\n") {
-		fmt.Fprintf(l.writer, "%s %s\n", p.prefix, line) // nolint:errcheck
+		fmt.Fprintf(l.writer, "%s%s\n", p.prefix, line) // nolint:errcheck
 	}
 }
 
@@ -118,5 +118,5 @@ type presenter struct {
 }
 
 func (p *presenter) setPrefix(width int) {
-	p.prefix = p.colors(fmt.Sprintf("%-"+strconv.Itoa(width)+"s |", p.name))
+	p.prefix = p.colors(fmt.Sprintf("%-"+strconv.Itoa(width)+"s | ", p.name))
 }