Skip to content

Conversation

@joshp123
Copy link
Contributor

As per https://github.com/getsentry/sentry-python/blob/master/tests/integrations/logging/test_logging.py#L46, extra data needs to be specified as a dict, passed as the keyword argument extra.

If you follow the current documentation, you get an error; c.f. with the updated way:

>>> logging.error('test', extras=dict(foo='asdf'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/Josh/.pyenv/versions/3.6.6/lib/python3.6/logging/__init__.py", line 1868, in error
    root.error(msg, *args, **kwargs)
  File "/Users/Josh/.pyenv/versions/3.6.6/lib/python3.6/logging/__init__.py", line 1336, in error
    self._log(ERROR, msg, args, **kwargs)
TypeError: _log() got an unexpected keyword argument 'extras'
>>> logging.error('test', extra=dict(foo='asdf'))
ERROR:root:test

As per https://github.com/getsentry/sentry-python/blob/master/tests/integrations/logging/test_logging.py#L46, extra data needs to be specified as a dict, passed as the keyword argument `extra`.

If you follow the current documentation, you get an error; c.f. with the updated way:
```
>>> logging.error('test', extras=dict(foo='asdf'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/Josh/.pyenv/versions/3.6.6/lib/python3.6/logging/__init__.py", line 1868, in error
    root.error(msg, *args, **kwargs)
  File "/Users/Josh/.pyenv/versions/3.6.6/lib/python3.6/logging/__init__.py", line 1336, in error
    self._log(ERROR, msg, args, **kwargs)
TypeError: _log() got an unexpected keyword argument 'extras'
>>> logging.error('test', extra=dict(foo='asdf'))
ERROR:root:test
```
@untitaker untitaker merged commit 65c9232 into getsentry:master Nov 13, 2018
@untitaker
Copy link
Member

Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Dec 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants