Report.send: log report sending success/error
This commit is contained in:
parent
2c442a2433
commit
64c2db5d5d
1 changed files with 5 additions and 1 deletions
|
@ -56,7 +56,11 @@ class Report(object): # pylint: disable=useless-object-inheritance
|
|||
subject=self.subject or subject,
|
||||
text_body=content
|
||||
)
|
||||
return email_client.send(self.rcpt_to or rcpt_to, msg=msg, just_try=just_try)
|
||||
if email_client.send(self.rcpt_to or rcpt_to, msg=msg, just_try=just_try):
|
||||
logging.debug('Report sent to %s', self.rcpt_to or rcpt_to)
|
||||
return True
|
||||
logging.error('Fail to send report to %s', self.rcpt_to or rcpt_to)
|
||||
return False
|
||||
|
||||
def send_at_exit(self, **kwargs):
|
||||
""" Send report at exit """
|
||||
|
|
Loading…
Reference in a new issue