Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc0eb43e

Browse files
muddi900jklymak
andauthored
added a note to avoid f-strings in logging (#25081)
* added a note to avoid f-strings in logging------Co-authored-by: Jody Klymak <jklymak@gmail.com>
1 parentbdb4935 commitc0eb43e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎doc/devel/contributing.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,12 @@ Then they will receive messages like
455455
DEBUG:matplotlib.yourmodulename:Here is some information
456456
DEBUG:matplotlib.yourmodulename:Here is some more detailed information
457457
458+
Avoid using pre-computed strings (``f-strings``, ``str.format``,etc.) for logging because of security and
459+
performance issues, and because they interfere with style handlers. For example, use ``_log.error('hello %s', 'world')`` rather than
460+
``_log.error('hello {}'.format('world'))`` or ``_log.error(f'hello {s}')``.
461+
462+
463+
458464
Which logging level to use?
459465
~~~~~~~~~~~~~~~~~~~~~~~~~~~
460466

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp