Add a default log alert

This commit is contained in:
Ian Fijolek
2020-02-18 00:47:43 +00:00
parent a7d1b8ab74
commit 65342fe0dd
2 changed files with 18 additions and 0 deletions
+5
View File
@@ -117,6 +117,11 @@ func LoadConfig(filePath string) (config Config, err error) {
log.Printf("DEBUG: Config values:\n%v\n", config)
}
if _, ok := config.Alerts["log"]; !ok {
log.Printf("Adding log alert")
config.Alerts["log"] = NewLogAlert()
}
if !config.IsValid() {
err = errors.New("Invalid configuration")
return