Commit 113d932d authored by Vinay Sajip's avatar Vinay Sajip

Merged upstream changes.

parents be2bee7b 8d927c20
...@@ -467,6 +467,9 @@ class Formatter(object): ...@@ -467,6 +467,9 @@ class Formatter(object):
self._fmt = self._style._fmt self._fmt = self._style._fmt
self.datefmt = datefmt self.datefmt = datefmt
default_time_format = '%Y-%m-%d %H:%M:%S'
default_msec_format = '%s,%03d'
def formatTime(self, record, datefmt=None): def formatTime(self, record, datefmt=None):
""" """
Return the creation time of the specified LogRecord as formatted text. Return the creation time of the specified LogRecord as formatted text.
...@@ -489,8 +492,8 @@ class Formatter(object): ...@@ -489,8 +492,8 @@ class Formatter(object):
if datefmt: if datefmt:
s = time.strftime(datefmt, ct) s = time.strftime(datefmt, ct)
else: else:
t = time.strftime("%Y-%m-%d %H:%M:%S", ct) t = time.strftime(self.default_time_format, ct)
s = "%s,%03d" % (t, record.msecs) # the use of % here is internal s = self.default_msec_format % (t, record.msecs)
return s return s
def formatException(self, ei): def formatException(self, ei):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment