From 17020cc79989f7f1e3d9718a829aad77ab500b3d Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 17 Nov 2023 15:20:21 +0100 Subject: [PATCH] rename flag --- client/flags/flags.go | 6 +++--- server/cmd/execute.go | 2 +- server/util.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/flags/flags.go b/client/flags/flags.go index fb403503f77e..b990252840cb 100644 --- a/client/flags/flags.go +++ b/client/flags/flags.go @@ -86,9 +86,9 @@ const ( // This differs from FlagOutputDocument that is used to set the output file. FlagOutput = "output" // Logging flags - FlagLogLevel = "log_level" - FlagLogFormat = "log_format" - FlagLogColored = "log_colored" + FlagLogLevel = "log_level" + FlagLogFormat = "log_format" + FlagLogNotColored = "log_not_colored" ) // List of supported output formats diff --git a/server/cmd/execute.go b/server/cmd/execute.go index 296ed1ebbde2..55651438988c 100644 --- a/server/cmd/execute.go +++ b/server/cmd/execute.go @@ -28,7 +28,7 @@ func Execute(rootCmd *cobra.Command, envPrefix, defaultHome string) error { rootCmd.PersistentFlags().String(flags.FlagLogLevel, zerolog.InfoLevel.String(), "The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:,:')") // NOTE: The default logger is only checking for the "json" value, any other value will default to plain text. rootCmd.PersistentFlags().String(flags.FlagLogFormat, "plain", "The logging format (json|plain)") - rootCmd.PersistentFlags().Bool(flags.FlagLogColored, false, "Enable colored logs") + rootCmd.PersistentFlags().Bool(flags.FlagLogNotColored, false, "Disable colored logs") executor := cmtcli.PrepareBaseCmd(rootCmd, envPrefix, defaultHome) return executor.ExecuteContext(ctx) diff --git a/server/util.go b/server/util.go index f9c1831d15c6..d8fe8de568d1 100644 --- a/server/util.go +++ b/server/util.go @@ -174,7 +174,7 @@ func CreateSDKLogger(ctx *Context, out io.Writer) (log.Logger, error) { opts = append(opts, log.OutputJSONOption()) } opts = append(opts, - log.ColorOption(ctx.Viper.GetBool(flags.FlagLogColored)), + log.ColorOption(!ctx.Viper.GetBool(flags.FlagLogNotColored)), // We use CometBFT flag (cmtcli.TraceFlag) for trace logging. log.TraceOption(ctx.Viper.GetBool(FlagTrace)))