]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
settings: Don't configure logging for parsearchive
authorStephen Finucane <stephen@that.guru>
Fri, 21 Sep 2018 16:59:48 +0000 (17:59 +0100)
committerStephen Finucane <stephen@that.guru>
Mon, 17 Jun 2019 14:39:34 +0000 (15:39 +0100)
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)

patchwork/management/commands/parsearchive.py
patchwork/parser.py
patchwork/settings/base.py

index bffb464790a6e09e0943f75a79b1c860ad0cbc8a..4e2bb46ac3b51f06b045b23f9ec73aa3885366ab 100644 (file)
@@ -97,8 +97,7 @@ class Command(BaseCommand):
                 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='')
index 1304e95ea8ecb1bbe5e6028228c3284a4d558680..a4762dbb45f532d5365d1b1d43733803025e19eb 100644 (file)
@@ -1175,7 +1175,6 @@ def parse_mail(mail, list_id=None):
 
     author = get_or_create_author(mail)
 
-
     try:
         comment = Comment.objects.create(
             submission=submission,
index 45c66da79e67723bfdc426f0794dd72c1b3b84f4..23b9fc95b4c66883c5d1b98a899103334f7820a9 100644 (file)
@@ -193,7 +193,7 @@ LOGGING = {
             'level': 'DEBUG',
             'propagate': False,
         },
-        'patchwork.management.commands': {
+        'patchwork.management.commands.parsemail': {
             'handlers': ['console', 'mail_admins'],
             'level': 'INFO',
             'propagate': True,