Releases: bugsnag/bugsnag-python
v3.4.1
v3.4.0
v3.3.0
v3.2.0
v3.1.2
v3.1.1
v3.1.0
v3.0.0
This is a major release adding a number of new features and deprecating some
lesser used parts of the library. See UPGRADING.md for upgrade instructions.
Enhancements
-
Add compatibility with Django 1.10
Jonny Pickett
#108 -
Support customizing delivery and sending error reports using
requests.The new
Deliveryclass is a generic way of sending a serialized payload to
Bugsnag. TheConfigurationclass now has adeliveryproperty which should
be an instance ofDelivery. By default, if requests is installed, reports
are sent viabugsnag.delivery.RequestsDeliveryrather than
bugsnag.delivery.UrllibDelivery.To enforce using urllib2/urllib3, use
UrllibDelivery:from bugsnag.delivery import UrllibDelivery bugsnag.configure(delivery=UrllibDelivery())
To use a custom
Delivery:from bugsnag.delivery import Delivery class SomeSpecialDelivery(Delivery): def deliver(self, config, payload): send_to_my_queue(config.get_endpoint(), config.proxy_host, payload) bugsnag.configure(delivery=SomeSpecialDelivery())
-
Support multiple clients in a single environment using
bugsnag.Client. A new
client can be initialized using aConfigurationor options passed to
Client(). By default, a client is installed as the system exception hook.
To disable this behavior, setinstall_sys_hooktoFalse.client = Client(api_key='...')
config = Configuration(api_key='...') client = Client(config)
-
Support running a block of code within a client's context. Any exception
raised will be reported.with client.capture(): raise Exception('an exception reported to Bugsnag then reraised')
Specific types of exceptions can be captured by adding
exceptionsas a
tuple.with client.capture((TypeError,)): raise Exception('an exception which does not get captured')
Additional options can be passed to th resulting error report, such as
attached metadata or severity.with client.capture(account_id='123', severity='info'): raise Exception('failed to validate record')
Functions can be decorated to capture any exceptions thrown during execution.
@client.capture def foo(): raise Exception('an exception passed to Bugsnag then reraised') @client.capture((TypeError,)) def bar(): raise Exception('an exception which does not get captured') @client.capture(test_slice='B') def baz(): raise Exception('an exception passed to Bugsnag then reraised')
-
Support creating a log handler from a client, and forwarding logged messages
to Bugsnag.client = Client(api_key='...') logger = logging.getLogger(__name__) logger.addHandler(client.log_handler())
Log messages can also be customized using additional information from the
log record and callbacks:client = Client(api_key='...') logger = logging.getLogger(__name__) handler = client.log_handler() def add_extra_info(record, options): if 'meta_data' not in options: options['meta_data'] = {} options['meta_data']['stats'] = { 'account_id': record.account_id, 'ab_test_slice': record.slice_name } handler.add_callback(add_extra_info) logger.addHandler(handler)
BugsnagHandlerargumentapi_keywas deprecated as a part of this change. -
Replace existing logging with a logger. Logs from bugsnag can now be
controlled by setting the log level oflogging.getLogger('bugsnag').
Kyle Fuller
#95 -
Wrap non-Exception objects passed to
notify()in aRuntimeError
Delisa Mason
#98
Bug fixes
- Fix proxy configuration setting a global opener
Kyle Fuller
#97 - Fix dropped reports during fatal errors occuring before threads join
Delisa Mason
#99 - Fix missing error reports when invoking a function decorated with a Bugsnag
client using the wrong arguments
Delisa Mason
#110
v3.0.0 beta 2
Enhancements
- Add compatibility with Django 1.10
Jonny Pickett
#108
Bug fixes
- Fix missing error reports when invoking a function decorated with a Bugsnag
client using the wrong arguments
Delisa Mason
#110