flaschengeist/geruecht/logger.py

30 lines
654 B
Python
Raw Normal View History

import logging
import logging.config
import yaml
from os import path, makedirs, getcwd
if not path.exists("geruecht/log/debug"):
a = path.join(path.curdir, "geruecht", "log", "debug")
makedirs(a)
if not path.exists("geruecht/log/info"):
b = path.join(path.curdir, "geruecht", "log", "info")
makedirs(b)
2020-06-17 18:51:35 +00:00
with open("geruecht/logging.yml", 'rb') as file:
config = yaml.safe_load(file.read())
logging.config.dictConfig(config)
2020-03-09 18:54:51 +00:00
def getDebugLogger():
return logging.getLogger("debug_logger")
def getCreditLogger():
return logging.getLogger("credit_logger")
def getJobsLogger():
return logging.getLogger("jobs_logger")