]> 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, 24 Sep 2018 10:26:00 +0000 (11:26 +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>
patchwork/management/commands/parsearchive.py
patchwork/parser.py
patchwork/settings/base.py

index e89041123d307442f20d8a303d1b187954973df0..37db2b0dc007e4968440ad2bd5b0af3a8feabca5 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 verbosity < 3 and (i % 10) == 0:
                 self.stdout.write('%06d/%06d\r' % (i, count), ending='')
index eb78702fac0a1cecedd5d737294df3fb8ee32227..2ba1db74542cf7a744f30d248f05ab3b95c1a81d 100644 (file)
@@ -1153,7 +1153,6 @@ def parse_mail(mail, list_id=None):
 
     author = get_or_create_author(mail)
 
-
     try:
         comment = Comment.objects.create(
             submission=submission,
index 3eb1f0e279fa5fe2dd3a3610c2a382904e5d7c42..1a62404fb43e523ae0a4879a0757393f254e4cfc 100644 (file)
@@ -185,7 +185,7 @@ LOGGING = {
             'level': 'WARNING',
             'propagate': False,
         },
-        'patchwork.management.commands': {
+        'patchwork.management.commands.parsemail': {
             'handlers': ['console', 'mail_admins'],
             'level': 'WARNING',
             'propagate': True,