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

@ -1,5 +1,4 @@
from typing import Any, List, Dict
import logging
import inflection
from math import floor
from datetime import datetime, timedelta
@ -8,6 +7,7 @@ from titles.wacca.config import WaccaConfig
from titles.wacca.const import WaccaConstants
from titles.wacca.database import WaccaData
import core.logger
from titles.wacca.handlers import *
from core.const import AllnetCountryCode
@ -19,7 +19,7 @@ class WaccaBase:
self.game = WaccaConstants.GAME_CODE # Game code
self.version = WaccaConstants.VER_WACCA # Game version
self.data = WaccaData(cfg) # Database
self.logger = logging.getLogger("wacca")
self.logger = core.logger.create_logger("Wacca", cfg, game_cfg.server.loglevel)
self.srvtime = datetime.now()
self.season = 1