diff --git a/traptor/traptor.py b/traptor/traptor.py index c17aeaf..e4dcdc6 100644 --- a/traptor/traptor.py +++ b/traptor/traptor.py @@ -217,6 +217,9 @@ def _add_rule_tag_and_value_to_tweet(self, tweet_dict, search_str, matched_rule) # Pass all key/value pairs from matched rule through to Traptor for key, value in matched_rule.iteritems(): tweet_dict['traptor'][key] = value + + # Log that a rule was matched + self.logger.info("Rule matched for tweet id: {}".format(tweet_dict['id_str'])) return tweet_dict @@ -280,6 +283,8 @@ def _find_rule_matches(self, tweet_dict): if 'rule_tag' not in new_dict['traptor']: new_dict['traptor']['rule_tag'] = 'Not found' new_dict['traptor']['rule_value'] = 'Not found' + # Log that a rule was matched + self.logger.warning("No rule matched for tweet id: {}".format(tweet_dict['id_str'])) return new_dict