From 1f24095c57577c9350c8dc339f1efd6b4cf1fbf5 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 27 Mar 2024 17:13:05 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20timestamp=20suppl=C3=A9mentaire=20dans?= =?UTF-8?q?=20log=20mail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/email.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/email.py b/app/email.py index cecaa68b9..5efe838fe 100644 --- a/app/email.py +++ b/app/email.py @@ -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}