Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cdc7517

Browse files
committed
Updated Formatter.formatTime documentation.
1 parent 0aaa9e1 commit cdc7517

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Doc/library/logging.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,13 @@ The useful mapping keys in a :class:`LogRecord` are given in the section on
453453
record. Otherwise, the ISO8601 format is used. The resulting string is
454454
returned.
455455

456+
This function uses a user-configurable function to convert the creation
457+
time to a tuple. By default, :func:`time.localtime` is used; to change
458+
this for a particular formatter instance, set the ``converter`` attribute
459+
to a function with the same signature as :func:`time.localtime` or
460+
:func:`time.gmtime`. To change it for all formatters, for example if you
461+
want all logging times to be shown in GMT, set the ``converter``
462+
attribute in the ``Formatter`` class.
456463

457464
.. method:: formatException(exc_info)
458465

0 commit comments

Comments
 (0)