summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBNMetrics <luna@bnmetrics.com>2018-10-15 18:41:36 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2018-10-15 18:41:36 (GMT)
commit18fb1fb943b7dbd7f8a76017ee2a67ef13effb85 (patch)
treeeb8236a053b1f1b5d46374d6271a53f2136fc1cd /Doc
parente890421e334ccf0c000c6b29c4a521d86cd12f47 (diff)
downloadcpython-18fb1fb943b7dbd7f8a76017ee2a67ef13effb85.zip
cpython-18fb1fb943b7dbd7f8a76017ee2a67ef13effb85.tar.gz
cpython-18fb1fb943b7dbd7f8a76017ee2a67ef13effb85.tar.bz2
bpo-34844: logging.Formatter enhancement - Ensure style and format string matches in logging.Formatter (GH-9703)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/logging.config.rst5
-rw-r--r--Doc/library/logging.rst4
2 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/logging.config.rst b/Doc/library/logging.config.rst
index de805eb..7f6c3c6 100644
--- a/Doc/library/logging.config.rst
+++ b/Doc/library/logging.config.rst
@@ -226,6 +226,11 @@ otherwise, the context is used to determine what to instantiate.
(with defaults of ``None``) and these are used to construct a
:class:`~logging.Formatter` instance.
+ .. versionchanged:: 3.8
+ a ``validate`` key (with default of ``True``) can be added into
+ the ``formatters`` section of the configuring dict, this is to
+ validate the format.
+
* *filters* - the corresponding value will be a dict in which each key
is a filter id and each value is a dict describing how to configure
the corresponding Filter instance.
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index c63ea21..71a46ac 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -544,6 +544,10 @@ The useful mapping keys in a :class:`LogRecord` are given in the section on
.. versionchanged:: 3.2
The *style* parameter was added.
+ .. versionchanged:: 3.8
+ The *validate* parameter was added. Incorrect or mismatched style and fmt
+ will raise a ``ValueError``.
+ For example: ``logging.Formatter('%(asctime)s - %(message)s', style='{')``.
.. method:: format(record)