Centralized logging

Allows us to extend the logging infrastructure, e.g. by adding Loki/Discord webhooks to the mix.
This commit is contained in:
2024-04-20 12:11:37 +00:00
parent 36ab38b1ee
commit 994fa0d41e
136 changed files with 340 additions and 847 deletions

View File

@ -3,10 +3,9 @@ import argparse
import yaml
from os import path, environ
import uvicorn
import logging
import asyncio
from core import CoreConfig, AimedbServlette
from core import CoreConfig, AimedbServlette, logger
async def launch_main(cfg: CoreConfig, ssl: bool) -> None:
if ssl:
@ -86,7 +85,7 @@ async def launcher(cfg: CoreConfig, ssl: bool) -> None:
return_when=asyncio.FIRST_COMPLETED,
)
logging.getLogger("core").info("Shutdown")
logger.create_logger("Core").info("Shutdown")
for pending_task in pending:
pending_task.cancel("Another service died, server is shutting down")