From 57f7f9252fdeb7f98e784ae44361eee19d25acca Mon Sep 17 00:00:00 2001 From: wangsiyuan <2392948297@qq.com> Date: Fri, 1 Mar 2024 18:33:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20huaweitest.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- huaweitest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/huaweitest.py b/huaweitest.py index f3f1a5a..d5b3168 100644 --- a/huaweitest.py +++ b/huaweitest.py @@ -57,14 +57,14 @@ async def do_success(request: Request): @app.get("/script/failed") -async def do_failed(reason: str = None): +async def do_failed(reason: str = None, errortype: str = None): # 获取当前时间 now = datetime.now() # 格式化时间为 年-月-日 时:分:秒 的格式 formatted_now = now.strftime("%Y-%m-%d %H:%M:%S") # 假设这里记录失败原因到日志或数据库 - print(f"上报失败,Time: {formatted_now}, 失败原因: {reason}") # 实际应用中应使用更专业的日志记录方式 + print(f"上报失败,Time: {formatted_now}, 失败原因: {reason},失败类型: {errortype}.") # 实际应用中应使用更专业的日志记录方式 return { "code": 0, "msg": "ok",