Skip to content

Commit

Permalink
filter expert: add debugging output for comparisons
Browse files Browse the repository at this point in the history
if users or devs run the bot in DEBUG log level, there was no useful
output yet.
This change adds two log statements, showing which comparision was made
  • Loading branch information
sebix committed Jul 9, 2024
1 parent bd6129f commit fdd209b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions intelmq/bots/experts/filter/expert.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ def doFilter(self, event, key, condition):
return self.equalsFilter(event, key, condition)

def equalsFilter(self, event, key, value):
self.logger.debug('Equality check: %r (event value) == %r (filter value).', event.get(key), value)
return (key in event and
event.get(key) == value)

def regexSearchFilter(self, event, key):
self.logger.debug('Regex filter: Matching %r against %r.', str(event.get(key)), self.filter_value)
if key in event:
return self.regex.search(str(event.get(key)))
else:
Expand Down

0 comments on commit fdd209b

Please sign in to comment.