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

Commita9d58fe

Browse files
authored
gh-84095: Fill documentation gap regarding user-defined objects. (GH-96574)
1 parent9e35d05 commita9d58fe

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

‎Doc/library/logging.config.rst‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,25 @@ mnemonic that the corresponding value is a callable.
534534
The ``filters`` member of ``handlers`` and ``loggers`` can take
535535
filter instances in addition to ids.
536536

537+
You can also specify a special key ``'.'`` whose value is a dictionary is a
538+
mapping of attribute names to values. If found, the specified attributes will
539+
be set on the user-defined object before it is returned. Thus, with the
540+
following configuration::
541+
542+
{
543+
'()' : 'my.package.customFormatterFactory',
544+
'bar' : 'baz',
545+
'spam' : 99.9,
546+
'answer' : 42,
547+
'.' {
548+
'foo': 'bar',
549+
'baz': 'bozz'
550+
}
551+
}
552+
553+
the returned formatter will have attribute ``foo`` set to ``'bar'`` and
554+
attribute ``baz`` set to ``'bozz'``.
555+
537556

538557
.. _logging-config-dict-externalobj:
539558

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp