We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0007c32 commit 3f70782Copy full SHA for 3f70782
4 files changed
doc/data/messages/l/logging-not-lazy/bad.py
@@ -0,0 +1,7 @@
1
+import logging
2
+
3
+try:
4
+ function()
5
+except Exception as e:
6
+ logging.error('Error occured: %s' % e) # [logging-not-lazy]
7
+ raise
doc/data/messages/l/logging-not-lazy/details.rst
@@ -0,0 +1,2 @@
+Another reasonable option is to use f-strings. If you want to do that, you need to enable
+``logging-not-lazy`` and disable ``logging-fstring-interpolation``.
doc/data/messages/l/logging-not-lazy/good.py
+ logging.error('Error occured: %s', e)
doc/data/messages/l/logging-not-lazy/related.rst
+- `Logging variable data <https://docs.python.org/3/howto/logging.html#logging-variable-data>`_
+- `Rationale <https://stackoverflow.com/questions/34619790>`_
0 commit comments