
from __future__ import absolute_import

import logging
from raven.handlers.logging import SentryHandler as BaseSentryHandler


class SentryHandler(BaseSentryHandler):
    def __init__(self):
        logging.Handler.__init__(self)

    def _get_client(self):
        from raven.contrib.django.models import client

        return client

    client = property(_get_client)

    def _emit(self, record):
        request = getattr(record, 'request', None)

        return super(SentryHandler, self)._emit(record, request=request)


from __future__ import absolute_import

import logging
from raven.handlers.logging import SentryHandler as BaseSentryHandler


class SentryHandler(BaseSentryHandler):
    def __init__(self, level=logging.NOTSET):
        logging.Handler.__init__(self, level=level)

    def _get_client(self):
        from raven.contrib.django.models import client

        return client

    client = property(_get_client)

    def _emit(self, record):
        request = getattr(record, 'request', None)

        return super(SentryHandler, self)._emit(record, request=request)

Allow level param in Django SentryHandler.__init__
Allow level param in Django SentryHandler.__init__

For consistency with superclass and with logging.Handler

  
  from __future__ import absolute_import
  
  import logging
  from raven.handlers.logging import SentryHandler as BaseSentryHandler
  
  
  class SentryHandler(BaseSentryHandler):
-     def __init__(self):
+     def __init__(self, level=logging.NOTSET):
-         logging.Handler.__init__(self)
+         logging.Handler.__init__(self, level=level)
  
      def _get_client(self):
          from raven.contrib.django.models import client
  
          return client
  
      client = property(_get_client)
  
      def _emit(self, record):
          request = getattr(record, 'request', None)
  
          return super(SentryHandler, self)._emit(record, request=request)
  
Allow level param in Django SentryHandler.__init__
## Code Before:

from __future__ import absolute_import

import logging
from raven.handlers.logging import SentryHandler as BaseSentryHandler


class SentryHandler(BaseSentryHandler):
    def __init__(self):
        logging.Handler.__init__(self)

    def _get_client(self):
        from raven.contrib.django.models import client

        return client

    client = property(_get_client)

    def _emit(self, record):
        request = getattr(record, 'request', None)

        return super(SentryHandler, self)._emit(record, request=request)

## Instruction:
Allow level param in Django SentryHandler.__init__
## Code After:

from __future__ import absolute_import

import logging
from raven.handlers.logging import SentryHandler as BaseSentryHandler


class SentryHandler(BaseSentryHandler):
    def __init__(self, level=logging.NOTSET):
        logging.Handler.__init__(self, level=level)

    def _get_client(self):
        from raven.contrib.django.models import client

        return client

    client = property(_get_client)

    def _emit(self, record):
        request = getattr(record, 'request', None)

        return super(SentryHandler, self)._emit(record, request=request)
