From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 5 Sep 2022 07:03:49 +0000 (-0700) Subject: [3.11] gh-84095: Fill documentation gap regarding user-defined objects. (GH-96574... X-Git-Tag: v3.11.0rc2~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d09069abfeba03da333b3ab90298dcc1ecdf5691;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-84095: Fill documentation gap regarding user-defined objects. (GH-96574) (GH-96575) --- diff --git a/Doc/library/logging.config.rst b/Doc/library/logging.config.rst index 310796e7ac6b..c36ad497f708 100644 --- a/Doc/library/logging.config.rst +++ b/Doc/library/logging.config.rst @@ -534,6 +534,25 @@ mnemonic that the corresponding value is a callable. The ``filters`` member of ``handlers`` and ``loggers`` can take 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: