Alerting: refactor notifiers to use package specific Logger interface (#60361)

* introduce Logger interface local to channles + implementaton that wraps the Grafana logger
* make NewFactoryConfig accept LoggerFactory
* add logger field to FactoryConfig
* update usages of log.Logger to internal interface
This commit is contained in:
Yuri Tseretyan
2022-12-15 11:10:31 -05:00
committed by GitHub
parent 0fb9987d12
commit 6637333748
48 changed files with 157 additions and 108 deletions
@@ -500,7 +500,9 @@ func (m *migration) validateAlertmanagerConfig(orgID int64, config *PostableUser
if !exists {
return fmt.Errorf("notifier %s is not supported", gr.Type)
}
factoryConfig, err := channels.NewFactoryConfig(cfg, nil, decryptFunc, nil, nil)
factoryConfig, err := channels.NewFactoryConfig(cfg, nil, decryptFunc, nil, nil, func(ctx ...interface{}) channels.Logger {
return &channels.FakeLogger{}
})
if err != nil {
return err
}