add more logging

This commit is contained in:
Son NK 2020-12-29 12:17:24 +01:00
parent 3b850f6228
commit 0df4d1a93d
2 changed files with 4 additions and 1 deletions

View File

@ -1398,6 +1398,9 @@ class EmailLog(db.Model, ModelMixin):
else:
return "forward"
def __repr__(self):
return f"<EmailLog {self.id}>"
class Subscription(db.Model, ModelMixin):
"""Paddle subscription"""

View File

@ -1655,7 +1655,7 @@ def get_spam_score(message: Message, email_log: EmailLog) -> float:
# wait for at max 300s which is the default spamd timeout-child
sa = SpamAssassin(sa_input, host=SPAMASSASSIN_HOST, timeout=300)
score = sa.get_score()
LOG.d("SA report, score %s. %s", score, sa.get_report_json())
LOG.d("SA report for %s, score %s. %s", email_log, score, sa.get_report_json())
return score
except Exception:
LOG.exception("SpamAssassin exception")