A recent change added additional ERROR level logs to the 'parsearchive'
tool. This highlighted an issue, whereby we had configured all modules
in 'patchwork.management.command' to email administrators on ERROR logs.
We clearly shouldn't be doing this for the 'parsearchive' command or for
anything other than 'parsemail', so fix this.
Along the way, we remove a now-unnecessary 'extra' argument to one of
the logging calls in 'parsearchive' and resolve a pep8 issue.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: 133091da ("parsearchive: Fix logging")
Cc: Daniel Axtens <dja@axtens.net>
(cherry picked from commit
aa266a28c6a022ad6952fac8f36afff0c540dccf)
logger.warning('Duplicate mail for message ID %s', exc.msgid)
except (ValueError, Exception) as exc:
errors += 1
- logger.warning('Invalid mail: %s', exc.message,
- extra={'mail': mail.as_string()})
+ logger.warning('Invalid mail: %s', exc.message)
if (i % 10) == 0:
self.stdout.write('%06d/%06d\r' % (i, count), ending='')
author = get_or_create_author(mail)
-
try:
comment = Comment.objects.create(
submission=submission,
'level': 'DEBUG',
'propagate': False,
},
- 'patchwork.management.commands': {
+ 'patchwork.management.commands.parsemail': {
'handlers': ['console', 'mail_admins'],
'level': 'INFO',
'propagate': True,