Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Commit

Permalink
Don't warn about uncategorized logs
Browse files Browse the repository at this point in the history
Summary:
There's a strong case that we should remove the categorization logic altogether,
but we certainly don't need to be warned when we fail to categorize, as that isn't
a problem, and I don't think we're even trying to categorize.

Test Plan: CHanges

Reviewers: josiah

Reviewed By: josiah

Subscribers: changesbot

Differential Revision: https://tails.corp.dropbox.com/D221609
  • Loading branch information
kylec1 committed Aug 19, 2016
1 parent 540fadc commit 5ec4000
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
10 changes: 0 additions & 10 deletions changes/listeners/analytics_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,6 @@ def _categorize_step_logs(job):
_incr("failing-log-processed")
if not tags and applicable:
_incr("failing-log-uncategorized")
logger.warning("Uncategorized log", extra={
# Supplying the 'data' this way makes it available in log handlers
# like Sentry while keeping the warnings grouped together.
# See https://github.com/getsentry/raven-python/blob/master/docs/integrations/logging.rst#usage
# for Sentry's interpretation.
'data': {
'logsource.id': ls.id.hex,
'log.url': ls.get_url(),
}
})
else:
for tag in tags:
_incr("failing-log-category-{}".format(tag))
Expand Down
6 changes: 2 additions & 4 deletions tests/changes/listeners/test_analytics_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,8 @@ def test_no_tags(self, get_rules_fn, categorize_fn):

tags_by_step = None
with mock.patch('changes.listeners.analytics_notifier._incr') as incr:
with mock.patch('changes.listeners.analytics_notifier.logger.warning') as warn:
tags_by_step = _categorize_step_logs(job)
warn.assert_any_call(mock.ANY, extra=mock.ANY)
incr.assert_any_call("failing-log-uncategorized")
tags_by_step = _categorize_step_logs(job)
incr.assert_any_call("failing-log-uncategorized")

categorize_fn.assert_called_with('project-slug', fake_rules, 'Some log text')
self.assertSetEqual(tags_by_step[step.id], set())
Expand Down

0 comments on commit 5ec4000

Please sign in to comment.