diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2018-05-04 21:20:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-04 21:20:54 (GMT) |
commit | c4994dc00d9828a99510f3851da93b0e1c18361d (patch) | |
tree | b59891f8791ccf7a9591bfa5c4c91384fe8d20d2 /Lib/logging | |
parent | 9d3627e311211a1b4abcda29c36fe4afe2c46532 (diff) | |
download | cpython-c4994dc00d9828a99510f3851da93b0e1c18361d.zip cpython-c4994dc00d9828a99510f3851da93b0e1c18361d.tar.gz cpython-c4994dc00d9828a99510f3851da93b0e1c18361d.tar.bz2 |
bpo-33400: Clarified documentation to indicate no strict adherence to ISO 8601. (GH-6702)
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 9f2c0f0..46c5906 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -466,7 +466,8 @@ class Formatter(object): Initialize the formatter either with the specified format string, or a default as described above. Allow for specialized date formatting with - the optional datefmt argument (if omitted, you get the ISO8601 format). + the optional datefmt argument. If datefmt is omitted, you get an + ISO8601-like (or RFC 3339-like) format. Use a style parameter of '%', '{' or '$' to specify that you want to use one of %-formatting, :meth:`str.format` (``{}``) formatting or @@ -494,13 +495,13 @@ class Formatter(object): in formatters to provide for any specific requirement, but the basic behaviour is as follows: if datefmt (a string) is specified, it is used with time.strftime() to format the creation time of the - 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, time.localtime() - is used; to change this for a particular formatter instance, set the - 'converter' attribute to a function with the same signature as - time.localtime() or time.gmtime(). To change it for all formatters, - for example if you want all logging times to be shown in GMT, + record. Otherwise, an ISO8601-like (or RFC 3339-like) 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, + time.localtime() is used; to change this for a particular formatter + instance, set the 'converter' attribute to a function with the same + signature as time.localtime() or 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. """ ct = self.converter(record.created) |