From 2affe4e244ad35d92d3de94363fb76806d33c199 Mon Sep 17 00:00:00 2001 From: Jacob Vecera Date: Thu, 12 Dec 2024 01:22:37 +0100 Subject: [PATCH] validate on run --- cmd/pbm-agent/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/pbm-agent/main.go b/cmd/pbm-agent/main.go index 3818cd5f6..15de1c214 100644 --- a/cmd/pbm-agent/main.go +++ b/cmd/pbm-agent/main.go @@ -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) {