From 95e225ef451d6c5f7d938afa61b302301e7fffbe Mon Sep 17 00:00:00 2001 From: Jarek Kowalski Date: Mon, 1 Mar 2021 08:40:33 -0800 Subject: [PATCH] logging: disable {color} and {color:reset} in console logs when --disable-color is passed (#860) --- internal/logfile/logfile.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/logfile/logfile.go b/internal/logfile/logfile.go index caff4eaa0..768100965 100644 --- a/internal/logfile/logfile.go +++ b/internal/logfile/logfile.go @@ -93,6 +93,11 @@ func setupConsoleBackend() logging.Backend { maybeTimestamp = "%{time:15:04:05.000} " ) + if *disableColor { + prefix = "" + suffix = "%{message}" + } + if !*consoleLogTimestamps { maybeTimestamp = "" }