diff options
author | Christian Fueller <christian.fueller@sap.com> | 2018-06-01 13:27:39 +0200 |
---|---|---|
committer | Ashley Camba <ashwoods@gmail.com> | 2018-07-24 14:24:16 +0200 |
commit | f6d79c3bcc25e804b6259fa9c4a6e030f9033bb2 (patch) | |
tree | 014aa2d30e9385b48ebf5e03a79912ccec7b50ce /tests/breadcrumbs | |
parent | a698fc406d2e0f26616f0163b2b22e1a3a5b30f5 (diff) | |
download | raven-f6d79c3bcc25e804b6259fa9c4a6e030f9033bb2.tar.gz |
Allow dict-style logging in breadcrumbs processing
Diffstat (limited to 'tests/breadcrumbs')
-rw-r--r-- | tests/breadcrumbs/tests.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/breadcrumbs/tests.py b/tests/breadcrumbs/tests.py index da291e5..923f479 100644 --- a/tests/breadcrumbs/tests.py +++ b/tests/breadcrumbs/tests.py @@ -39,6 +39,20 @@ class BreadcrumbTestCase(TestCase): assert crumbs[0]['data'] == {'blah': 'baz'} assert crumbs[0]['message'] == 'This is a message with foo!' + def test_log_crumb_reporting_with_dict(self): + client = Client('http://foo:bar@example.com/0') + with client.context: + log = logging.getLogger('whatever.foo') + log.info('This is a message with %(foo)s!', {'foo': 'bar'}, + extra={'blah': 'baz'}) + crumbs = client.context.breadcrumbs.get_buffer() + + assert len(crumbs) == 1 + assert crumbs[0]['type'] == 'default' + assert crumbs[0]['category'] == 'whatever.foo' + assert crumbs[0]['data'] == {'foo': 'bar', 'blah': 'baz'} + assert crumbs[0]['message'] == 'This is a message with bar!' + def test_log_crumb_reporting_with_large_message(self): client = Client('http://foo:bar@example.com/0') with client.context: |