From 84f2168f806699b4c7116a0c49cf75aabf9a5f5a Mon Sep 17 00:00:00 2001 From: Jan Vitturi Date: Sat, 14 May 2022 11:00:39 +0200 Subject: [PATCH] Fix extra space printed with `--no-log-prefix` option Signed-off-by: Jan Vitturi --- cmd/formatter/logs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/formatter/logs.go b/cmd/formatter/logs.go index 5543ca86..2cc9c84e 100644 --- a/cmd/formatter/logs.go +++ b/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)) }