How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.42.1
Steps to Reproduce
- Install sentry 2.24.1
- Try to run:
from sentry_sdk import logger
logger.debug("any text with {braces} in it")
- Sentry will raise uncaught exception:
File ".venv\Lib\site-packages\sentry_sdk\logger.py", line 54, in _capture_log
"body": template.format(**kwargs),
~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'braces'
This has major impact on any app trying to log for example json as raw text.
This is a new bug, introduced in 2.42.x
Expected Result
Sentry should not crash when logging template strings
Actual Result
venv\Lib\site-packages\sentry_sdk\logger.py", line 54, in _capture_log
"body": template.format(**kwargs),
~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'braces'