Skip to content

Commit

Permalink
rename flag
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Nov 17, 2023
1 parent 340614b commit 17020cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions client/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion server/cmd/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 '*:<level>,<key>:<level>')")
// 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)
Expand Down
2 changes: 1 addition & 1 deletion server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down

0 comments on commit 17020cc

Please sign in to comment.