diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-06-10 18:05:16 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-06-10 18:05:16 (GMT) |
commit | 89c00ce33a82b4ee6b91d802cfa7ba3e47a04bfa (patch) | |
tree | 191314d5293512a80f556a3bc5be3aa62294b350 | |
parent | bbbee04ef42b3fc7173e6e2f315211f23c342eb9 (diff) | |
download | cpython-89c00ce33a82b4ee6b91d802cfa7ba3e47a04bfa.zip cpython-89c00ce33a82b4ee6b91d802cfa7ba3e47a04bfa.tar.gz cpython-89c00ce33a82b4ee6b91d802cfa7ba3e47a04bfa.tar.bz2 |
Updated Formatter.formatTime docs to indicate configuration via class attributes.
-rw-r--r-- | Doc/library/logging.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index eb2c718..62f04d8 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -453,6 +453,18 @@ 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. + .. versionchanged:: 3.3 + Previously, the default ISO 8601 format was hard-coded as in this + example: ``2010-09-06 22:38:15,292`` where the part before the comma is + handled by a strptime format string (``'%Y-%m-%d %H:%M:%S'``), and the + part after the comma is a millisecond value. Because strptime does not + have a format placeholder for milliseconds, the millisecond value is + appended using another format string, ``'%s,%03d'`` – and both of these + format strings have been hardcoded into this method. With the change, + these strings are defined as class-level attributes which can be + overridden at the instance level when desired. The names of the + attributes are ``default_time_format`` (for the strptime format string) + and ``default_msec_format`` (for appending the millisecond value). .. method:: formatException(exc_info) |