forked from Hay1tsme/artemis
Centralized logging
Allows us to extend the logging infrastructure, e.g. by adding Loki/Discord webhooks to the mix.
This commit is contained in:
5
index.py
5
index.py
@ -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")
|
||||
|
||||
|
Reference in New Issue
Block a user