mirror of https://github.com/pypa/pip
Merge pull request #9367 from hugovk/rm-2-default_time_format
Use Formatter.default_time_format after dropping PY2
This commit is contained in:
commit
363132659b
|
@ -81,6 +81,7 @@ def get_indentation():
|
||||||
|
|
||||||
|
|
||||||
class IndentingFormatter(logging.Formatter):
|
class IndentingFormatter(logging.Formatter):
|
||||||
|
default_time_format = "%Y-%m-%dT%H:%M:%S"
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
@ -119,9 +120,7 @@ class IndentingFormatter(logging.Formatter):
|
||||||
|
|
||||||
prefix = ''
|
prefix = ''
|
||||||
if self.add_timestamp:
|
if self.add_timestamp:
|
||||||
# TODO: Use Formatter.default_time_format after dropping PY2.
|
prefix = f"{self.formatTime(record)} "
|
||||||
t = self.formatTime(record, "%Y-%m-%dT%H:%M:%S")
|
|
||||||
prefix = '{t},{record.msecs:03.0f} '.format(**locals())
|
|
||||||
prefix += " " * get_indentation()
|
prefix += " " * get_indentation()
|
||||||
formatted = "".join([
|
formatted = "".join([
|
||||||
prefix + line
|
prefix + line
|
||||||
|
|
Loading…
Reference in New Issue