repair translations
This commit is contained in:
parent
98581132dd
commit
84adc5d941
18 changed files with 304 additions and 122 deletions
18
SRV/main.py
18
SRV/main.py
|
|
@ -28,6 +28,24 @@ import uvicorn
|
|||
from api.router import router
|
||||
from config.cors import CORSMiddlewareConfig
|
||||
from services.network_service import NetworkService
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
# Логируем в файл logs/app.log и одновременно в stdout
|
||||
LOG_DIR = Path(__file__).resolve().parent / "logs"
|
||||
LOG_DIR.mkdir(parents=True, exist_ok=True)
|
||||
LOG_FILE = LOG_DIR / "app.log"
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
||||
handlers=[
|
||||
logging.StreamHandler(),
|
||||
logging.FileHandler(LOG_FILE, encoding="utf-8"),
|
||||
],
|
||||
force=True, # переопределяем базовую конфигурацию, заданную в импортируемых модулях
|
||||
)
|
||||
# Глушим шум от hot-reload watchdog
|
||||
logging.getLogger("watchfiles").setLevel(logging.WARNING)
|
||||
|
||||
app = FastAPI(
|
||||
title="GONETS",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue