Automated Action 77865dae90 Setup complete FastAPI backend with user authentication, client management, and invoice generation
Features:
- User authentication with JWT
- Client management with CRUD operations
- Invoice generation and management
- SQLite database with Alembic migrations
- Detailed project documentation
2025-05-26 17:41:47 +00:00

37 lines
787 B
Python

import sys
from loguru import logger
from app.core.config import settings
# Configure loguru logger
LOG_LEVEL = settings.LOG_LEVEL
LOG_FORMAT = (
"<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | "
"<level>{level: <8}</level> | "
"<cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - "
"<level>{message}</level>"
)
# Configure logger
logger.remove() # Remove default logger
logger.add(
sys.stderr,
format=LOG_FORMAT,
level=LOG_LEVEL,
colorize=True,
)
# Add file logging
log_file = settings.STORAGE_DIR / "logs" / "app.log"
log_file.parent.mkdir(parents=True, exist_ok=True)
logger.add(
log_file,
rotation="10 MB",
retention="30 days",
level=LOG_LEVEL,
format=LOG_FORMAT,
)
# Make logger available
app_logger = logger