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)