From ddb4235bfebf41fceb9fc8074ea863ca773daec7 Mon Sep 17 00:00:00 2001 From: Hmily <961532186@qq.com> Date: Sat, 28 Sep 2024 00:39:40 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8A=20Enable=20logging=20for=20email?= =?UTF-8?q?=20utils=20by=20default=20(#1374)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- backend/app/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/app/utils.py b/backend/app/utils.py index 2679937..38cff81 100644 --- a/backend/app/utils.py +++ b/backend/app/utils.py @@ -11,6 +11,9 @@ from jwt.exceptions import InvalidTokenError from app.core.config import settings +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + @dataclass class EmailData: @@ -48,7 +51,7 @@ def send_email( if settings.SMTP_PASSWORD: smtp_options["password"] = settings.SMTP_PASSWORD response = message.send(to=email_to, smtp=smtp_options) - logging.info(f"send email result: {response}") + logger.info(f"send email result: {response}") def generate_test_email(email_to: str) -> EmailData: