[Python-checkins] cpython (merge 3.2 -> default): Merged doc fix in 3.2.

vinay.sajip python-checkins at python.org
Fri Apr 8 02:35:16 CEST 2011


http://hg.python.org/cpython/rev/93f6ffe53b99
changeset:   69195:93f6ffe53b99
parent:      69193:9ddba521c3aa
parent:      69194:c760390165dc
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Fri Apr 08 01:32:27 2011 +0100
summary:
  Merged doc fix in 3.2.

files:
  Doc/library/logging.rst |  11 +++++++++--
  1 files changed, 9 insertions(+), 2 deletions(-)


diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -405,7 +405,7 @@
 :ref:`logrecord-attributes`.
 
 
-.. class:: Formatter(fmt=None, datefmt=None)
+.. class:: Formatter(fmt=None, datefmt=None, style='%')
 
    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
@@ -413,6 +413,14 @@
    specified, ``'%(message)s'`` is used.  If no *datefmt* is specified, the
    ISO8601 date format is used.
 
+   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`. 
+
+   .. versionchanged:: 3.2
+      The *style* parameter was added.
+
+
    .. method:: format(record)
 
       The record's attribute dictionary is used as the operand to a string
@@ -691,7 +699,6 @@
 information into logging calls. For a usage example , see the section on
 :ref:`adding contextual information to your logging output <context-info>`.
 
-
 .. class:: LoggerAdapter(logger, extra)
 
    Returns an instance of :class:`LoggerAdapter` initialized with an

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list