Skip to content

Commit 0814a80

Browse files
[3.10] [doc] Add some notices to logging configuration documentation. (GH-101373) (GH-101375)
Co-authored-by: Vinay Sajip <[email protected]>
1 parent a259efc commit 0814a80

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Doc/library/logging.config.rst

+10
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,11 @@ returned by the call::
519519

520520
my.package.customFormatterFactory(bar='baz', spam=99.9, answer=42)
521521

522+
.. warning:: The values for keys such as ``bar``, ``spam`` and ``answer`` in
523+
the above example should not be configuration dictionaries or references such
524+
as ``cfg://foo`` or ``ext://bar``, because they will not be processed by the
525+
configuration machinery, but passed to the callable as-is.
526+
522527
The key ``'()'`` has been used as the special key because it is not a
523528
valid keyword parameter name, and so will not clash with the names of
524529
the keyword arguments used in the call. The ``'()'`` also serves as a
@@ -543,6 +548,11 @@ following configuration::
543548
the returned formatter will have attribute ``foo`` set to ``'bar'`` and
544549
attribute ``baz`` set to ``'bozz'``.
545550

551+
.. warning:: The values for attributes such as ``foo`` and ``baz`` in
552+
the above example should not be configuration dictionaries or references such
553+
as ``cfg://foo`` or ``ext://bar``, because they will not be processed by the
554+
configuration machinery, but set as attribute values as-is.
555+
546556

547557
.. _logging-config-dict-externalobj:
548558

0 commit comments

Comments
 (0)