Why python log message with WARNING logging level is not rendered properly showing log formatting kwargs instead of real values?
Thanks,
Alex
EDIT: Looks like Sentry doesn't know how to render the log message using kwargs passed through the context variable. Formatting using args works for me perfectly:
logger.warning(
exc.__class__.__name__ + ' -> Attempts (%d) are over for %r', 1, dict.fromkeys, exc_info=exc,
)
But still I consider this like an issue, because Python logging module handles both approaches on default:
The msg is the message format string, and the args are the arguments which are merged into msg using the string formatting operator. (Note that this means that you can use keywords in the format string, together with a single dictionary argument.)
Hi guys, I wrote as simple project spawning 2 logging events (it's a bit rusty, but it was just created for testing purposes):
This an output which we receive on web UI: screen_1 screen_2
Why python log message with
WARNING
logging level is not rendered properly showing log formattingkwargs
instead of real values?Thanks, Alex
EDIT: Looks like Sentry doesn't know how to render the log message using
kwargs
passed through thecontext
variable. Formatting usingargs
works for me perfectly:But still I consider this like an issue, because Python logging module handles both approaches on default: