From dd94655f4d39b238b318f0a0f9450bf4a38a30c9 Mon Sep 17 00:00:00 2001 From: Grigory Starinkin Date: Sat, 20 Jul 2019 11:14:56 +0100 Subject: [PATCH] fix log formatting of iterable objects --- pelican/log.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pelican/log.py b/pelican/log.py index 6f353264..905c2e37 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -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):