From 21ad901377d756865fd64bc289bc9912a18d2754 Mon Sep 17 00:00:00 2001 From: shishishizhan Date: Sun, 13 Apr 2025 15:08:24 +0800 Subject: [PATCH] =?UTF-8?q?2025/04/13=20=E5=91=A8=E6=97=A5=2015:08:24.35?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/utils/qiniu_storage.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/utils/qiniu_storage.py b/backend/utils/qiniu_storage.py index 1254fc6..8c4dfe8 100644 --- a/backend/utils/qiniu_storage.py +++ b/backend/utils/qiniu_storage.py @@ -4,6 +4,8 @@ import time import os from PIL import Image from io import BytesIO +import logging +logger = logging.getLogger(__name__) class QiniuStorage: def __init__(self): @@ -55,7 +57,9 @@ class QiniuStorage: 'url': private_url, 'msg': '上传成功' } + # 在 except 中添加日志 except Exception as e: + logger.error(f"七牛云上传失败: {str(e)}") return { 'code': 400, 'msg': f'上传失败:{str(e)}'