pferd/PFERD/__init__.py

44 lines
1.0 KiB
Python
Raw Normal View History

2019-04-25 21:41:26 +02:00
import logging
from .ffm import *
2018-11-26 14:39:06 +01:00
from .ilias import *
from .norbert import *
2019-10-15 15:34:59 +02:00
from .tgi import *
2019-11-14 15:37:57 +01:00
from .tgi_jimbo import *
2019-05-06 13:54:36 +02:00
from .ti import *
2020-02-27 14:51:29 +01:00
from .os_exams import *
from .utils import *
2019-04-25 21:41:26 +02:00
__all__ = ["STYLE", "FORMAT", "DATE_FORMAT", "FORMATTER", "enable_logging"]
__all__ += ffm.__all__
__all__ += ilias.__all__
__all__ += norbert.__all__
2019-10-15 15:34:59 +02:00
__all__ += tgi.__all__
2019-11-14 15:37:57 +01:00
__all__ += tgi_jimbo.__all__
2019-05-06 13:54:36 +02:00
__all__ += ti.__all__
__all__ += utils.__all__
2020-02-27 14:51:29 +01:00
__all__ += os_exams.__all__
2019-04-25 21:41:26 +02:00
STYLE = "{"
FORMAT = "[{levelname:<7}] {message}"
DATE_FORMAT = "%F %T"
FORMATTER = logging.Formatter(
fmt=FORMAT,
datefmt=DATE_FORMAT,
style=STYLE,
)
def enable_logging(name="PFERD", level=logging.INFO):
handler = logging.StreamHandler()
handler.setFormatter(FORMATTER)
logger = logging.getLogger(name)
logger.setLevel(level)
logger.addHandler(handler)
# This should be logged by our own handler, and not the root logger's
# default handler, so we don't pass it on to the root logger.
logger.propagate = False