diff options
author | David Röthlisberger <david@stb-tester.com> | 2019-09-09 11:29:54 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2019-09-09 11:29:54 (GMT) |
commit | 4f0f9f066e72255c88d4ec9e9f8e510903577713 (patch) | |
tree | 26bb1d0ffbb0da35edb828dc064fd7ba1559075a | |
parent | 9d607061c9c888913ae2c18543775cf360d55f27 (diff) | |
download | cpython-4f0f9f066e72255c88d4ec9e9f8e510903577713.zip cpython-4f0f9f066e72255c88d4ec9e9f8e510903577713.tar.gz cpython-4f0f9f066e72255c88d4ec9e9f8e510903577713.tar.bz2 |
logging.Formatter docs: Add missing `validate` parameter, clarify `style` parameter (GH-15222)
-rw-r--r-- | Doc/library/logging.rst | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index cc611fc..dec27bf 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -528,7 +528,7 @@ The useful mapping keys in a :class:`LogRecord` are given in the section on :ref:`logrecord-attributes`. -.. class:: Formatter(fmt=None, datefmt=None, style='%') +.. class:: Formatter(fmt=None, datefmt=None, style='%', validate=True) Returns a new instance of the :class:`Formatter` class. The instance is initialized with a format string for the message as a whole, as well as a @@ -538,8 +538,11 @@ The useful mapping keys in a :class:`LogRecord` are given in the section on The *style* parameter can be one of '%', '{' or '$' and determines how the format string will be merged with its data: using one of %-formatting, - :meth:`str.format` or :class:`string.Template`. See :ref:`formatting-styles` - for more information on using {- and $-formatting for log messages. + :meth:`str.format` or :class:`string.Template`. This only applies to the + format string *fmt* (e.g. ``'%(message)s'`` or ``{message}``), not to the + actual log messages passed to ``Logger.debug`` etc; see + :ref:`formatting-styles` for more information on using {- and $-formatting + for log messages. .. versionchanged:: 3.2 The *style* parameter was added. |