mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-14 14:10:12 +01:00
Made the notification level flag global for all notification types.
This commit is contained in:
parent
4ac08dfb30
commit
e1ead2f46f
5 changed files with 26 additions and 24 deletions
|
|
@ -14,17 +14,12 @@ type slackTypeNotifier struct {
|
|||
slackrus.SlackrusHook
|
||||
}
|
||||
|
||||
func newSlackNotifier(c *cli.Context) typeNotifier {
|
||||
logLevel, err := log.ParseLevel(c.GlobalString("notification-slack-level"))
|
||||
if err != nil {
|
||||
log.Fatalf("Slack notifications: %s", err.Error())
|
||||
}
|
||||
|
||||
func newSlackNotifier(c *cli.Context, acceptedLogLevels []log.Level) typeNotifier {
|
||||
n := &slackTypeNotifier{
|
||||
SlackrusHook: slackrus.SlackrusHook{
|
||||
HookURL: c.GlobalString("notification-slack-hook-url"),
|
||||
Username: c.GlobalString("notification-slack-identifier"),
|
||||
AcceptedLevels: slackrus.LevelThreshold(logLevel),
|
||||
AcceptedLevels: acceptedLogLevels,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue