Skip to content

Commit

Permalink
🐛 improve logs in engine
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Gaikwad <[email protected]>
  • Loading branch information
pranavgaikwad committed Mar 6, 2024
1 parent 1b4e897 commit 4b8df69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (r *ruleEngine) RunRules(ctx context.Context, ruleSets []RuleSet, selectors
} else if response.ConditionResponse.Matched && len(response.ConditionResponse.Incidents) > 0 {
violation, err := r.createViolation(ctx, response.ConditionResponse, response.Rule)
if err != nil {
r.logger.Error(err, "unable to create violation from response")
r.logger.Error(err, "unable to create violation from response", "ruleID", response.Rule.RuleID)
}
if len(violation.Incidents) == 0 {
r.logger.V(5).Info("rule was evaluated and incidents were filtered out to make it unmatched", "rule", response.Rule.RuleID)
Expand Down Expand Up @@ -333,7 +333,7 @@ func (r *ruleEngine) runTaggingRules(ctx context.Context, infoRules []ruleMessag
}
templateString, err := r.createPerformString(tagString, variables)
if err != nil {
r.logger.Error(err, "unable to create tag string")
r.logger.Error(err, "unable to create tag string", "ruleID", rule.RuleID)
continue
}
tags[templateString] = true
Expand Down

0 comments on commit 4b8df69

Please sign in to comment.