aurweb/aurweb/logging.py
Kevin Morris 55c0637b98 add logging.config.fileConfig
This resolves logging issues with alembic on aurweb.initdb
in addition to adding more logging utilities for aurweb
and tests in general.

Developers should fetch a logger for their specific module
via `logging.getLogger(__name__)`.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-24 18:56:38 -07:00

11 lines
287 B
Python

import logging
import logging.config
import os
import aurweb.config
aurwebdir = aurweb.config.get("options", "aurwebdir")
config_path = os.path.join(aurwebdir, "logging.conf")
logging.config.fileConfig(config_path, disable_existing_loggers=False)
logger = logging.getLogger(__name__)