mirror of
https://github.com/pim-n/pg-rad
synced 2026-02-03 14:43:08 +01:00
17 lines
367 B
Python
17 lines
367 B
Python
import logging
|
|
import logging.config
|
|
import pathlib
|
|
|
|
import yaml
|
|
|
|
def setup_logger(name):
|
|
logger = logging.getLogger(name)
|
|
|
|
base_dir = pathlib.Path(__file__).resolve().parent
|
|
config_file = base_dir / "configs" / "logging.yml"
|
|
|
|
with open(config_file) as f:
|
|
config = yaml.safe_load(f)
|
|
|
|
logging.config.dictConfig(config)
|
|
return logger |