diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-02-26 14:15:48 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-02-26 14:15:48 (GMT) |
commit | 859c7fac781866b910a59fec71a52a64bbd0a2e9 (patch) | |
tree | 4af501e6fdf909574331e18900d7de64fb4eac0e /Lib/logging | |
parent | dcc20b85632b8a4ffa43563080ab4ea08b4e9914 (diff) | |
download | cpython-859c7fac781866b910a59fec71a52a64bbd0a2e9.zip cpython-859c7fac781866b910a59fec71a52a64bbd0a2e9.tar.gz cpython-859c7fac781866b910a59fec71a52a64bbd0a2e9.tar.bz2 |
Issue #11330: asctime format bug fixed.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index e1c4a37..d61699e 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -360,12 +360,13 @@ class PercentStyle(object): default_format = '%(message)s' asctime_format = '%(asctime)s' + asctime_search = '%(asctime)' def __init__(self, fmt): self._fmt = fmt or self.default_format def usesTime(self): - return self._fmt.find(self.asctime_format) >= 0 + return self._fmt.find(self.asctime_search) >= 0 def format(self, record): return self._fmt % record.__dict__ @@ -373,6 +374,7 @@ class PercentStyle(object): class StrFormatStyle(PercentStyle): default_format = '{message}' asctime_format = '{asctime}' + asctime_search = '{asctime' def format(self, record): return self._fmt.format(**record.__dict__) @@ -381,6 +383,7 @@ class StrFormatStyle(PercentStyle): class StringTemplateStyle(PercentStyle): default_format = '${message}' asctime_format = '${asctime}' + asctime_search = '{asctime' def __init__(self, fmt): self._fmt = fmt or self.default_format |