1
0
mirror of https://github.com/containrrr/watchtower.git synced 2025-07-12 23:50:20 +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

View File

@ -25,6 +25,10 @@ func NewNotifier(c *cobra.Command) *Notifier {
} }
acceptedLogLevels := slackrus.LevelThreshold(logLevel) 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. // Parse types and create notifiers.
types, err := f.GetStringSlice("notifications") types, err := f.GetStringSlice("notifications")