1
0
mirror of https://github.com/containrrr/watchtower.git synced 2024-12-12 09:04:17 +02:00

fix: Disallow log level 'trace' (#765)

Co-authored-by: Simon Aronsson <simme@arcticbit.se>
This commit is contained in:
Zois Pagoulatos 2021-01-12 20:19:14 +01:00 committed by GitHub
parent eccf87a47d
commit d04d71508f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")