How to use the bugsnag.logger function in bugsnag

To help you get started, we’ve selected a few bugsnag examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bugsnag / bugsnag-python / tests / test_handlers.py View on Github external
def tearDown(self):
        super(HandlersTest, self).tearDown()
        bugsnag.logger.setLevel(logging.CRITICAL)
github bugsnag / bugsnag-python / tests / __init__.py View on Github external
import logging

import bugsnag


logging.getLogger('requests').setLevel(logging.CRITICAL)
bugsnag.logger.setLevel(logging.CRITICAL)
github bugsnag / bugsnag-python / tests / test_handlers.py View on Github external
def setUp(self):
        super(HandlersTest, self).setUp()
        bugsnag.configure(use_ssl=False,
                          endpoint=self.server.address,
                          api_key='tomatoes',
                          notify_release_stages=['dev'],
                          release_stage='dev',
                          asynchronous=False)
        bugsnag.logger.setLevel(logging.INFO)
github bugsnag / bugsnag-python / bugsnag / client.py View on Github external
if notification.api_key is None:
                    bugsnag.logger.warning(
                        "No API key configured, couldn't notify")
                    return
                if initial_severity != notification.severity:
                    notification.severity_reason = {
                        'type': 'userCallbackSetSeverity'
                    }
                else:
                    notification.severity_reason = initial_reason
                payload = notification._payload()
                try:
                    self.configuration.delivery.deliver(self.configuration,
                                                        payload)
                except Exception as e:
                    bugsnag.logger.exception('Notifying Bugsnag failed %s', e)
                # Trigger session delivery
                self.session_tracker.send_sessions()
github bugsnag / bugsnag-python / bugsnag / middleware.py View on Github external
# the last step in the notification stack is to call the callback.
        # we also do this inside the exception handler, so need to ensure that
        # the callback is only called once.
        def finish(notification):
            if not hasattr(finish, 'called'):
                finish.called = True
                callback()

        to_call = finish
        for middleware in reversed(self.stack):
            to_call = middleware(to_call)

        try:
            to_call(notification)
        except Exception:
            bugsnag.logger.exception('Error in exception middleware')
            # still notify if middleware crashes before notification
            finish(notification)
github bugsnag / bugsnag-python / bugsnag / django / middleware.py View on Github external
def process_exception(self, request, exception):
        try:
            bugsnag.auto_notify(
                exception,
                severity_reason={
                    "type": "unhandledExceptionMiddleware",
                    "attributes": {
                        "framework": "Django"
                    }
                }
            )

        except Exception:
            bugsnag.logger.exception("Error in exception middleware")

        bugsnag.clear_request_config()

        return None