3 ms·
It's not just performance! Using percent formatting is superior in many ways: - errors that occur in formatting a message will be logged instead of raising an
by MapleWalnut 7y ago
It's not just performance!
Using percent formatting is superior in many ways:
- errors that occur in formatting a message will be logged instead of raising an exception into your application
- error reporting services like Sentry can properly aggregate events
- interpolation won't occur if you don't have the logging level enabled
- it's recommend by the Python docs: https://docs.python.org/3/howto/logging-cookbook.html#use-of-alternative-formatting-styles https://docs.python.org/3/howto/logging-cookbook.html#use-of...