Skip to content

Commit

Permalink
Increase default log level to Warn
Browse files Browse the repository at this point in the history
trivial commands (like `tk env list` on a fresh repo) should not log unless `--log-level` is increased from default
  • Loading branch information
rrotter committed Jun 5, 2024
1 parent b957fd9 commit 6c8c66c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/tk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func main() {
func addCommandsWithLogLevelOption(rootCmd *cli.Command, cmds ...*cli.Command) {
for _, cmd := range cmds {
levels := []string{zerolog.Disabled.String(), zerolog.FatalLevel.String(), zerolog.ErrorLevel.String(), zerolog.WarnLevel.String(), zerolog.InfoLevel.String(), zerolog.DebugLevel.String(), zerolog.TraceLevel.String()}
cmd.Flags().String("log-level", zerolog.InfoLevel.String(), "possible values: "+strings.Join(levels, ", "))
cmd.Flags().String("log-level", zerolog.WarnLevel.String(), "possible values: "+strings.Join(levels, ", "))

cmdRun := cmd.Run
cmd.Run = func(cmd *cli.Command, args []string) error {
Expand Down

0 comments on commit 6c8c66c

Please sign in to comment.