Ajout timestamp supplémentaire dans log mail

This commit is contained in:
Emmanuel Viennet 2024-03-27 17:13:05 +01:00
parent 0ed2455028
commit 1f24095c57
1 changed files with 6 additions and 2 deletions

View File

@ -5,6 +5,7 @@
# See LICENSE
##############################################################################
import datetime
from threading import Thread
from flask import current_app, g
@ -83,9 +84,12 @@ Adresses d'origine:
\n\n"""
+ msg.body
)
now = datetime.datetime.now()
formatted_time = now.strftime("%Y-%m-%d %H:%M:%S") + ".{:03d}".format(
now.microsecond // 1000
)
current_app.logger.info(
f"""email sent to{
f"""[{formatted_time}] email sent to{
' (mode test)' if email_test_mode_address else ''
}: {msg.recipients}
from sender {msg.sender}