From 22fb08795a8caa27f49590abac2d89c0ab539a07 Mon Sep 17 00:00:00 2001 From: aaron <> Date: Sat, 1 Mar 2025 09:26:39 +0800 Subject: [PATCH] update --- app/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 3b78c6f..a87b673 100644 --- a/app/main.py +++ b/app/main.py @@ -88,7 +88,9 @@ async def health_check(): @app.exception_handler(Exception) async def exception_handler(request, exc): - logging.exception(f"API异常: {str(exc)}") + env = "测试环境" if settings.DEBUG else "生产环境" + + logging.exception(f"【{env}】API异常: {str(exc)}") # 发送企业微信消息 wecom_bot = WecomBot(settings.URL_WECOMBOT_SYS_EXCEPTION)