feat: replace all print statements with proper logging system

This commit is contained in:
Сергей Антропов
2025-08-20 17:19:49 +03:00
parent f3221d6102
commit a49714ab14
6 changed files with 96 additions and 25 deletions

View File

@@ -11,8 +11,9 @@ from fastapi import FastAPI, Request, HTTPException
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from app.core.config import DEBUG_MODE, SNAP_DIR, STATIC_DIR
from app.core.config import DEBUG_MODE, SNAP_DIR, STATIC_DIR, APP_PORT
from app.api.v1.router import api_router, pages_router
from app.core.logger import app_logger
# Инициализация FastAPI
app = FastAPI(
@@ -81,11 +82,11 @@ app.include_router(pages_router)
if __name__ == "__main__":
import uvicorn
print(f"LogBoard+ http://0.0.0.0:{APP_PORT}")
print(f"Debug mode: {'ON' if DEBUG_MODE else 'OFF'}")
app_logger.info(f"LogBoard+ http://0.0.0.0:{APP_PORT}")
app_logger.info(f"Debug mode: {'ON' if DEBUG_MODE else 'OFF'}")
if DEBUG_MODE:
print("Swagger UI: http://0.0.0.0:{}/docs".format(APP_PORT))
print("ReDoc: http://0.0.0.0:{}/redoc".format(APP_PORT))
app_logger.info("Swagger UI: http://0.0.0.0:{}/docs".format(APP_PORT))
app_logger.info("ReDoc: http://0.0.0.0:{}/redoc".format(APP_PORT))
uvicorn.run(
app,
host="0.0.0.0",