canonical / is-charms-contributing-guide

The code contributing guide for the IS charms team
Apache License 2.0
2 stars 1 forks source link

Don't use f-strings in log messages #13

Closed jdkandersson closed 2 years ago

jdkandersson commented 2 years ago

See here, it is a security problem: https://bugs.python.org/issue46200

mthaddon commented 2 years ago

Also, I believe f-strings are evaluated whether the logging call is active or not. For example, if you have a line that says logger.debug('{}'.format(msg)) it will cause the string formatting to be done even if you're using the info level logging setting.