Skip to content

Commit

Permalink
log rule not found
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelsq committed Jun 29, 2020
1 parent 3a69a38 commit 3329596
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/wtc/wtc.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ func retrieveRegexp(pattern string) *regexp.Regexp {

func findAndTrig(sync bool, key []string, pkg, path string) {
for _, s := range key {
found := false
for _, r := range config.Rules {
if r.Name == s {
r := r
Expand All @@ -287,9 +288,18 @@ func findAndTrig(sync bool, key []string, pkg, path string) {
go fn()
}

found = true
break
}
}

if !found {
_ = failFormat.Execute(os.Stderr, formatPayload{
Name: s,
Time: time.Now().Format("15:04:05"),
Error: "rule not found",
})
}
}
}

Expand Down

0 comments on commit 3329596

Please sign in to comment.