logging: do not log into the root logger

Deprecate `ipa_log_manager.root_logger` and replace all calls to it with
module-level logger calls.

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Jan Cholasta
2017-05-24 14:35:07 +00:00
committed by Martin Basti
parent ab9d1e75fc
commit 7a482b7c72
71 changed files with 1605 additions and 1460 deletions

View File

@@ -25,12 +25,13 @@ If the plugin is active, sets up IPA logging to also log to Beaker.
import logging
from ipapython.ipa_log_manager import Formatter, root_logger
from ipapython.ipa_log_manager import Formatter
def pytest_configure(config):
plugin = config.pluginmanager.getplugin('BeakerLibPlugin')
if plugin:
root_logger = logging.getLogger()
root_logger.setLevel(logging.DEBUG)
handler = BeakerLibLogHandler(plugin.run_beakerlib_command)

View File

@@ -23,7 +23,7 @@ import os
import sys
import logging
from ipapython.ipa_log_manager import Formatter, root_logger
from ipapython.ipa_log_manager import Formatter
def pytest_addoption(parser):
@@ -64,4 +64,5 @@ def pytest_configure(config):
handler = LogHandler()
handler.setFormatter(Formatter('[%(name)s] %(message)s'))
handler.setLevel(config.getoption('logging_level'))
root_logger = logging.getLogger()
root_logger.addHandler(handler)