Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
Respect CELERY_LOGLEVEL setting in SentryDjangoHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Til Boerner committed Jul 2, 2018
1 parent 93b8aab commit 99e3a8e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions raven/contrib/django/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,12 @@ def install_celery(self):
ignore_expected=ignore_expected)\
.install()

# try:
# ga = lambda x, d=None: getattr(settings, 'SENTRY_%s' % x, d)
# options = getattr(settings, 'RAVEN_CONFIG', {})
# loglevel = options.get('celery_loglevel',
# ga('CELERY_LOGLEVEL', logging.ERROR))

# register_logger_signal(client, loglevel=loglevel)
# except Exception:
# logger.exception('Failed to install Celery error handler')
loglevel = (
getattr(settings, 'RAVEN_CONFIG', {}).get('CELERY_LOGLEVEL')
or getattr(settings, 'SENTRY_CELERY_LOGLEVEL', None)
)
if loglevel is not None:
register_logger_signal(client, loglevel=loglevel)

def install(self):
request_started.connect(self.before_request, weak=False)
Expand Down

0 comments on commit 99e3a8e

Please sign in to comment.