(logging): Add multiprocess support for logging.

This commit is contained in:
2023-07-18 10:35:10 +03:00
parent e54c6bc62d
commit f4769b407e
5 changed files with 51 additions and 32 deletions

View File

@@ -7,7 +7,7 @@ from discord.ext import commands
from meta import LionBot, conf, sharding, appname, shard_talk
from meta.app import shardname
from meta.logger import log_context, log_action_stack, logging_context
from meta.logger import log_context, log_action_stack, logging_context, setup_main_logger
from meta.context import ctx_bot
from data import Database
@@ -20,6 +20,10 @@ from constants import DATA_VERSION
for name in conf.config.options('LOGGING_LEVELS', no_defaults=True):
logging.getLogger(name).setLevel(conf.logging_levels[name])
setup_main_logger()
logger = logging.getLogger(__name__)
db = Database(conf.data['args'])