-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
main.py
37 lines (29 loc) · 975 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from dotenv import load_dotenv
import logging
from pathlib import Path
# Create logs directory if it doesn't exist
logs_dir = Path("logs")
logs_dir.mkdir(exist_ok=True)
# Configure logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[
# File handler for general application logs
logging.FileHandler('logs/app.log'),
# Stream handler for console output
logging.StreamHandler()
]
)
# Suppress verbose fontTools logging
logging.getLogger('fontTools').setLevel(logging.WARNING)
logging.getLogger('fontTools.subset').setLevel(logging.WARNING)
logging.getLogger('fontTools.ttLib').setLevel(logging.WARNING)
# Create logger instance
logger = logging.getLogger(__name__)
load_dotenv()
from backend.server.server import app
if __name__ == "__main__":
import uvicorn
logger.info("Starting server...")
uvicorn.run(app, host="0.0.0.0", port=8000)