How to use the bugsnag.logger.warning 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 / bugsnag / delivery.py View on Github external
'http': config.proxy_host
                })

                opener = build_opener(proxies)
            else:
                opener = build_opener()

            resp = opener.open(req)
            status = resp.getcode()

            if 'success' in options:
                success = options['success']
            else:
                success = 200
            if status != success:
                bugsnag.logger.warning(
                    'Delivery to %s failed, status %d' % (uri, status))
github bugsnag / bugsnag-python / bugsnag / client.py View on Github external
def send_payload():
                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 / legacy.py View on Github external
if 'severity' in options:
        options['severity_reason'] = {'type': 'userSpecifiedSeverity'}
    else:
        options['severity_reason'] = {'type': 'handledException'}

    if (isinstance(exception, (list, tuple)) and len(exception) == 3 and
            isinstance(exception[2], types.TracebackType)):
        default_client.notify_exc_info(*exception, **options)
    else:
        if not isinstance(exception, BaseException):
            try:
                value = repr(exception)
            except Exception:
                value = '[BADENCODING]'

            bugsnag.logger.warning('Coercing invalid notify()'
                                   ' value to RuntimeError: %s' % value)
            exception = RuntimeError(value)

        default_client.notify(exception, **options)
github bugsnag / bugsnag-python / bugsnag / delivery.py View on Github external
if config.proxy_host:
                req_options['proxies'] = {
                    'https': config.proxy_host,
                    'http': config.proxy_host
                }

            response = requests.post(uri, **req_options)
            status = response.status_code
            if 'success' in options:
                success = options['success']
            else:
                success = requests.codes.ok

            if status != success:
                bugsnag.logger.warning(
                    'Delivery to %s failed, status %d' % (uri, status))