utils.py 476 Bytes
Newer Older
Johannes Bechberger's avatar
Johannes Bechberger committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
import logging
from os import path
from rainbow_logging_handler import RainbowLoggingHandler
import sys


def get_mjtest_basedir() -> str:
    return path.dirname(path.dirname(path.dirname(path.abspath(__file__))))


""" Colored logging handler that is used for the root logger """
handler = RainbowLoggingHandler(sys.stderr, color_funcName=('black', 'yellow', True))
handler.setFormatter(logging.Formatter("[%(asctime)s] %(message)s"))
logging.getLogger().addHandler(handler)