fix log formatting of iterable objects

This commit is contained in:
Grigory Starinkin 2019-07-20 11:14:56 +01:00
commit dd94655f4d
No known key found for this signature in database
GPG key ID: 6A32D1F8AB4C166A

View file

@ -28,9 +28,10 @@ class BaseFormatter(logging.Formatter):
record.__dict__['customlevelname'] = customlevel
# format multiline messages 'nicely' to make it clear they are together
record.msg = record.msg.replace('\n', '\n | ')
record.args = tuple(arg.replace('\n', '\n | ') if
isinstance(arg, six.string_types) else
arg for arg in record.args)
if isinstance(args, tuple):
record.args = tuple(arg.replace('\n', '\n | ') if
isinstance(arg, six.string_types) else
arg for arg in record.args)
return super(BaseFormatter, self).format(record)
def formatException(self, ei):