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>
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 verbosity < 3 and (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': 'WARNING',
'propagate': False,
},
- 'patchwork.management.commands': {
+ 'patchwork.management.commands.parsemail': {
'handlers': ['console', 'mail_admins'],
'level': 'WARNING',
'propagate': True,