Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/data/messages/l/logging-not-lazy/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import logging

try:
function()
except Exception as e:
logging.error('Error occured: %s' % e) # [logging-not-lazy]
raise
2 changes: 2 additions & 0 deletions doc/data/messages/l/logging-not-lazy/details.rst
Original file line number Diff line number Diff line change
@@ -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``.
7 changes: 7 additions & 0 deletions doc/data/messages/l/logging-not-lazy/good.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import logging

try:
function()
except Exception as e:
logging.error('Error occured: %s', e)
raise
2 changes: 2 additions & 0 deletions doc/data/messages/l/logging-not-lazy/related.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- `Logging variable data <https://docs.python.org/3/howto/logging.html#logging-variable-data>`_
- `Rationale <https://stackoverflow.com/questions/34619790>`_
โšก