Files
BiliNote/backend/events/handlers.py
Jefferyhcool 1ebf236f4f feat(app): 添加日志记录功能
- 新增 logger 模块,用于全局日志记录
- 在关键位置添加日志输出,包括事件处理、文件清理、FFmpeg 检查等
- 优化数据库操作,增加日志记录
- 在主程序启动时添加日志输出
2025-04-14 19:50:44 +08:00

15 lines
447 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import os
from app.utils.logger import get_logger
logger = get_logger(__name__)
def cleanup_temp_files(data):
logger.info(f"starting cleanup temp files {data['file_path']}")
os.remove(data['file_path'])
# 检查是否删除文件
if os.path.exists(data['file_path']):
logger.info(f"cleanup temp files failed {data['file_path']}")
else:
logger.info(f"cleanup temp files success {data['file_path']}")