Skip to content

Commit

Permalink
Use Formatter.default_time_format after dropping PY2
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Dec 27, 2020
1 parent 2fb341a commit b92c0c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Empty file.
5 changes: 2 additions & 3 deletions src/pip/_internal/utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def get_indentation():


class IndentingFormatter(logging.Formatter):
default_time_format = "%Y-%m-%dT%H:%M:%S"

def __init__(self, *args, **kwargs):
"""
Expand Down Expand Up @@ -139,9 +140,7 @@ def format(self, record):

prefix = ''
if self.add_timestamp:
# TODO: Use Formatter.default_time_format after dropping PY2.
t = self.formatTime(record, "%Y-%m-%dT%H:%M:%S")
prefix = '{t},{record.msecs:03.0f} '.format(**locals())
prefix = f"{self.formatTime(record)} "
prefix += " " * get_indentation()
formatted = "".join([
prefix + line
Expand Down

0 comments on commit b92c0c1

Please sign in to comment.