mirror of
https://github.com/python/cpython.git
synced 2025-11-10 22:36:18 +00:00
gh-84095: Fill documentation gap regarding user-defined objects. (GH-96574)
This commit is contained in:
parent
9e35d05422
commit
a9d58feccf
1 changed files with 19 additions and 0 deletions
|
|
@ -534,6 +534,25 @@ mnemonic that the corresponding value is a callable.
|
||||||
The ``filters`` member of ``handlers`` and ``loggers`` can take
|
The ``filters`` member of ``handlers`` and ``loggers`` can take
|
||||||
filter instances in addition to ids.
|
filter instances in addition to ids.
|
||||||
|
|
||||||
|
You can also specify a special key ``'.'`` whose value is a dictionary is a
|
||||||
|
mapping of attribute names to values. If found, the specified attributes will
|
||||||
|
be set on the user-defined object before it is returned. Thus, with the
|
||||||
|
following configuration::
|
||||||
|
|
||||||
|
{
|
||||||
|
'()' : 'my.package.customFormatterFactory',
|
||||||
|
'bar' : 'baz',
|
||||||
|
'spam' : 99.9,
|
||||||
|
'answer' : 42,
|
||||||
|
'.' {
|
||||||
|
'foo': 'bar',
|
||||||
|
'baz': 'bozz'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
the returned formatter will have attribute ``foo`` set to ``'bar'`` and
|
||||||
|
attribute ``baz`` set to ``'bozz'``.
|
||||||
|
|
||||||
|
|
||||||
.. _logging-config-dict-externalobj:
|
.. _logging-config-dict-externalobj:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue