From d04d71508f40d3ed027a9d06c67deea26afc1cc0 Mon Sep 17 00:00:00 2001 From: Zois Pagoulatos Date: Tue, 12 Jan 2021 20:19:14 +0100 Subject: [PATCH] fix: Disallow log level 'trace' (#765) Co-authored-by: Simon Aronsson --- pkg/notifications/notifier.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/notifications/notifier.go b/pkg/notifications/notifier.go index dea0fc8..651ab6a 100644 --- a/pkg/notifications/notifier.go +++ b/pkg/notifications/notifier.go @@ -25,6 +25,10 @@ func NewNotifier(c *cobra.Command) *Notifier { } acceptedLogLevels := slackrus.LevelThreshold(logLevel) + // slackrus does not allow log level TRACE, even though it's an accepted log level for logrus + if len(acceptedLogLevels) == 0 { + log.Fatalf("Unsupported notification log level provided: %s", level) + } // Parse types and create notifiers. types, err := f.GetStringSlice("notifications")