kiwi-el8/kiwi/__init__.py
Marcus Schäfer bdb7123fa1
Refactor use of logging facility
Use getLogger method instead of a global log object
Also use caplog fixture to capture log messages in
unit tests. This Fixes #1244
2019-10-23 17:54:27 +02:00

14 lines
480 B
Python

import logging
from kiwi.logger import Logger
# Initialize custom logger class for kiwi
logging.setLoggerClass(Logger)
# Set the highest log level possible as the default log level
# in the main Logger class. This is needed to allow any logfile
# handler to log all messages by default and to allow custom log
# levels per handler. Our own implementation in Logger::setLogLevel
# will then set the log level on a handler basis
logging.getLogger('kiwi').setLevel(logging.DEBUG)