Skip to content

Commit a9d58fe

Browse files
authored
gh-84095: Fill documentation gap regarding user-defined objects. (GH-96574)
1 parent 9e35d05 commit a9d58fe

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Doc/library/logging.config.rst

+19
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)