@@ -524,6 +524,25 @@ valid keyword parameter name, and so will not clash with the names of
524
524
the keyword arguments used in the call. The ``'()' `` also serves as a
525
525
mnemonic that the corresponding value is a callable.
526
526
527
+ You can also specify a special key ``'.' `` whose value is a dictionary is a
528
+ mapping of attribute names to values. If found, the specified attributes will
529
+ be set on the user-defined object before it is returned. Thus, with the
530
+ following configuration::
531
+
532
+ {
533
+ '()' : 'my.package.customFormatterFactory',
534
+ 'bar' : 'baz',
535
+ 'spam' : 99.9,
536
+ 'answer' : 42,
537
+ '.' {
538
+ 'foo': 'bar',
539
+ 'baz': 'bozz'
540
+ }
541
+ }
542
+
543
+ the returned formatter will have attribute ``foo `` set to ``'bar' `` and
544
+ attribute ``baz `` set to ``'bozz' ``.
545
+
527
546
528
547
.. _logging-config-dict-externalobj :
529
548
@@ -706,7 +725,7 @@ root logger section is given below.
706
725
707
726
The ``level `` entry can be one of ``DEBUG, INFO, WARNING, ERROR, CRITICAL `` or
708
727
``NOTSET ``. For the root logger only, ``NOTSET `` means that all messages will be
709
- logged. Level values are :func: ` eval ` \ uated in the context of the ``logging ``
728
+ logged. Level values are :ref: ` evaluated < func- eval>` in the context of the ``logging ``
710
729
package's namespace.
711
730
712
731
The ``handlers `` entry is a comma-separated list of handler names, which must
@@ -753,13 +772,13 @@ handler. If blank, a default formatter (``logging._defaultFormatter``) is used.
753
772
If a name is specified, it must appear in the ``[formatters] `` section and have
754
773
a corresponding section in the configuration file.
755
774
756
- The ``args `` entry, when :func: ` eval ` \ uated in the context of the ``logging ``
775
+ The ``args `` entry, when :ref: ` evaluated < func- eval>` in the context of the ``logging ``
757
776
package's namespace, is the list of arguments to the constructor for the handler
758
777
class. Refer to the constructors for the relevant handlers, or to the examples
759
778
below, to see how typical entries are constructed. If not provided, it defaults
760
779
to ``() ``.
761
780
762
- The optional ``kwargs `` entry, when :func: ` eval ` \ uated in the context of the
781
+ The optional ``kwargs `` entry, when :ref: ` evaluated < func- eval>` in the context of the
763
782
``logging `` package's namespace, is the keyword argument dict to the constructor
764
783
for the handler class. If not provided, it defaults to ``{} ``.
765
784
@@ -823,7 +842,7 @@ Sections which specify formatter configuration are typified by the following.
823
842
[formatter_form01]
824
843
format =F1 %(asctime)s %(levelname)s %(message)s
825
844
datefmt =
826
- style =' % '
845
+ style =%
827
846
validate =True
828
847
class =logging.Formatter
829
848
0 commit comments