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,11 +1,9 @@
import logging
import json
from datetime import datetime, timedelta
from time import strftime
import pytz
from typing import Dict, Any, List
import core.logger
from core.config import CoreConfig
from titles.chuni.const import ChuniConstants
from titles.chuni.database import ChuniData
@ -18,7 +16,7 @@ class ChuniBase:
self.game_cfg = game_cfg
self.data = ChuniData(core_cfg)
self.date_time_format = "%Y-%m-%d %H:%M:%S"
self.logger = logging.getLogger("chuni")
self.logger = core.logger.create_logger("Chunithm", logger_name="chuni")
self.game = ChuniConstants.GAME_CODE
self.version = ChuniConstants.VER_CHUNITHM