Skip to content

Commit

Permalink
validate on run
Browse files Browse the repository at this point in the history
  • Loading branch information
veceraj committed Dec 12, 2024
1 parent 71584c6 commit 2affe4e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/pbm-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ func rootCommand() *cobra.Command {
return errors.New("required flag " + mongoConnFlag + " not set")
}

if !isValidLogLevel(viper.GetString("log.level")) {
return errors.New("invalid log level")
}

return nil
},
Run: func(cmd *cobra.Command, args []string) {
Expand Down

0 comments on commit 2affe4e

Please sign in to comment.