From ed861044a78d70cdae6da8c1f13ea095ca2601fd Mon Sep 17 00:00:00 2001 From: Prabhat Khera <91852476+prabhat-org@users.noreply.github.com> Date: Thu, 15 Feb 2024 06:26:22 +1300 Subject: [PATCH] =?UTF-8?q?Revert=20"fix(logs):=20add=20NOCOLOR=20option?= =?UTF-8?q?=20for=20use=20when=20exporting=20to=20greylog=20etc=20[?= =?UTF-8?q?=E2=80=A6"=20(#11178)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit aca6d33548beee919276bb6d35f150d48dcb1202. --- api/cli/cli.go | 2 +- api/cmd/portainer/log.go | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/api/cli/cli.go b/api/cli/cli.go index 32c60910f..d951d71b3 100644 --- a/api/cli/cli.go +++ b/api/cli/cli.go @@ -62,7 +62,7 @@ func (*Service) ParseFlags(version string) (*portainer.CLIFlags, error) { MaxBatchDelay: kingpin.Flag("max-batch-delay", "Maximum delay before a batch starts").Duration(), SecretKeyName: kingpin.Flag("secret-key-name", "Secret key name for encryption and will be used as /run/secrets/.").Default(defaultSecretKeyName).String(), LogLevel: kingpin.Flag("log-level", "Set the minimum logging level to show").Default("INFO").Enum("DEBUG", "INFO", "WARN", "ERROR"), - LogMode: kingpin.Flag("log-mode", "Set the logging output mode").Default("PRETTY").Enum("NOCOLOR", "PRETTY", "JSON"), + LogMode: kingpin.Flag("log-mode", "Set the logging output mode").Default("PRETTY").Enum("PRETTY", "JSON"), } kingpin.Parse() diff --git a/api/cmd/portainer/log.go b/api/cmd/portainer/log.go index 7ec861421..63eaf872d 100644 --- a/api/cmd/portainer/log.go +++ b/api/cmd/portainer/log.go @@ -42,13 +42,6 @@ func setLoggingMode(mode string) { TimeFormat: "2006/01/02 03:04PM", FormatMessage: formatMessage, }) - case "NOCOLOR": - log.Logger = log.Output(zerolog.ConsoleWriter{ - Out: os.Stderr, - TimeFormat: "2006/01/02 03:04PM", - FormatMessage: formatMessage, - NoColor: true, - }) case "JSON": log.Logger = log.Output(os.Stderr) }