Skip to content

Commit 1016909

Browse files
[3.11] [doc] Add some notices to logging configuration documentation. (GH-101373) (GH-101376)
Co-authored-by: Vinay Sajip <[email protected]>
1 parent fa7c37a commit 1016909

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
@@ -525,6 +525,11 @@ returned by the call::
525525

526526
my.package.customFormatterFactory(bar='baz', spam=99.9, answer=42)
527527

528+
.. warning:: The values for keys such as ``bar``, ``spam`` and ``answer`` in
529+
the above example should not be configuration dictionaries or references such
530+
as ``cfg://foo`` or ``ext://bar``, because they will not be processed by the
531+
configuration machinery, but passed to the callable as-is.
532+
528533
The key ``'()'`` has been used as the special key because it is not a
529534
valid keyword parameter name, and so will not clash with the names of
530535
the keyword arguments used in the call. The ``'()'`` also serves as a
@@ -553,6 +558,11 @@ following configuration::
553558
the returned formatter will have attribute ``foo`` set to ``'bar'`` and
554559
attribute ``baz`` set to ``'bozz'``.
555560

561+
.. warning:: The values for attributes such as ``foo`` and ``baz`` in
562+
the above example should not be configuration dictionaries or references such
563+
as ``cfg://foo`` or ``ext://bar``, because they will not be processed by the
564+
configuration machinery, but set as attribute values as-is.
565+
556566

557567
.. _logging-config-dict-externalobj:
558568

0 commit comments

Comments
 (0)