summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2011-06-13 13:59:36 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2011-06-13 13:59:36 (GMT)
commitad52cb26133011c88e3fdceee1aadb31fc07b997 (patch)
treeb08364f7cc097b3ecb8ca4d3c9c8144461a858b4 /Doc/library
parent0eb4ac4c6258ecbcbcb65022f3987fe30f31f527 (diff)
downloadcpython-ad52cb26133011c88e3fdceee1aadb31fc07b997.zip
cpython-ad52cb26133011c88e3fdceee1aadb31fc07b997.tar.gz
cpython-ad52cb26133011c88e3fdceee1aadb31fc07b997.tar.bz2
Closes #12206: documentation update for LogRecord constructor and Formatter.formatTime.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/logging.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index 7578d6a..b666573 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -416,6 +416,13 @@ The useful mapping keys in a :class:`LogRecord` are given in the section on
record. Otherwise, the ISO8601 format is used. The resulting string is
returned.
+ This function uses a user-configurable function to convert the creation
+ time to a tuple. By default, :func:`time.localtime` is used; to change
+ this for a particular formatter instance, set the ``converter`` attribute
+ to a function with the same signature as :func:`time.localtime` or
+ :func:`time.gmtime`. To change it for all formatters, for example if you
+ want all logging times to be shown in GMT, set the ``converter``
+ attribute in the ``Formatter`` class.
.. method:: formatException(exc_info)
@@ -491,6 +498,9 @@ wire).
:param name: The name of the logger used to log the event represented by
this LogRecord.
:param level: The numeric level of the logging event (one of DEBUG, INFO etc.)
+ Note that this is converted to *two* attributes of the LogRecord:
+ ``levelno`` for the numeric value and ``levelname`` for the
+ corresponding level name.
:param pathname: The full pathname of the source file where the logging call
was made.
:param lineno: The line number in the source file where the logging call was