diff --git a/server/main.py b/server/main.py index 37fd7ab..ac7fc38 100644 --- a/server/main.py +++ b/server/main.py @@ -1,6 +1,8 @@ from pathlib import Path from typing import List +import logging + from dotenv import load_dotenv from fastapi import FastAPI, HTTPException, Request from fastapi.middleware.cors import CORSMiddleware @@ -29,6 +31,7 @@ RESOURCES_DIR = ROOT_DIR / "resources" load_dotenv(dotenv_path=ROOT_DIR / ".env") app = FastAPI() +logger = logging.getLogger("tts") app.add_middleware( CORSMiddleware, @@ -103,6 +106,7 @@ def api_create_tts(payload: TtsCreateRequest): try: text_to_mp3(text=text, mp3_path=str(mp3_path)) except Exception as exc: + logger.exception("TTS 생성 실패") delete_item_by_id(tts_id) raise HTTPException(status_code=500, detail=str(exc)) from exc