Skip to content

Commit

Permalink
added a note to avoid f-strings in logging (matplotlib#25081)
Browse files Browse the repository at this point in the history
* added a note to avoid f-strings in logging

------

Co-authored-by: Jody Klymak <jklymak@gmail.com>
  • Loading branch information
muddi900 and jklymak authored Mar 6, 2023
1 parent bdb4935 commit c0eb43e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/devel/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,12 @@ Then they will receive messages like
DEBUG:matplotlib.yourmodulename:Here is some information
DEBUG:matplotlib.yourmodulename:Here is some more detailed information
Avoid using pre-computed strings (``f-strings``, ``str.format``,etc.) for logging because of security and
performance issues, and because they interfere with style handlers. For example, use ``_log.error('hello %s', 'world')`` rather than
``_log.error('hello {}'.format('world'))`` or ``_log.error(f'hello {s}')``.



Which logging level to use?
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit c0eb43e

Please sign in to comment.