wow-addons/BigBrother/bb/config/__init__.py

37 lines
976 B
Python

import logging
from pathlib import Path
import yaml
logger = logging.getLogger(__name__)
here = Path(__file__).parent.resolve()
buffs = yaml.safe_load(here.joinpath("buffs.yaml").read_text("utf8"))
class_overrides = yaml.safe_load(here.joinpath("class_overrides.yaml").read_text("utf8"))
def get_logging_config(level="WARNING") -> dict:
return {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)-7s] %(name)s:%(funcName)s - %(message)s"
}
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"stream": "ext://sys.stdout",
"formatter": "standard",
"level": level,
}
},
"loggers": {
"bb": {
"level": "DEBUG",
"handlers": ["console"]
}
},
}