Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions Lib/logging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,10 +741,7 @@ def __init__(self, linefmt=None):
Optionally specify a formatter which will be used to format each
individual record.
"""
if linefmt:
self.linefmt = linefmt
else:
self.linefmt = _defaultFormatter
self.linefmt = linefmt or _defaultFormatter

def formatHeader(self, records):
"""
Expand Down Expand Up @@ -991,10 +988,7 @@ def format(self, record):
If a formatter is set, use it. Otherwise, use the default formatter
for the module.
"""
if self.formatter:
fmt = self.formatter
else:
fmt = _defaultFormatter
fmt = self.formatter or _defaultFormatter
return fmt.format(record)

def emit(self, record):
Expand Down
Loading