]> granicus.if.org Git - python/commitdiff
Improved logging.Formatter date/time formatting documentation.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Mon, 30 Aug 2010 18:10:03 +0000 (18:10 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Mon, 30 Aug 2010 18:10:03 +0000 (18:10 +0000)
Doc/library/logging.rst

index f257643b72702c1b8a8cec0ab3538492003239bc..e82be99f9bbbefef96d55b1b9577ed8b4e13bd9b 100644 (file)
@@ -321,6 +321,14 @@ order::
 
     "%(asctime)s - %(levelname)s - %(message)s"
 
+Formatters use a user-configurable function to convert the creation time of a
+record to a tuple. By default, :func:`time.localtime` is used; to change this
+for a particular formatter instance, set the ``converter`` attribute of the
+instance 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 (to ``time.gmtime`` for GMT display).
+
 
 Configuring Logging
 ^^^^^^^^^^^^^^^^^^^