mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
logging: make sure logging level is set to proper value
During py.test initialization, the value 'debug' is passed instead of logging.DEBUG. Signed-off-by: Tomas Krizek <tkrizek@redhat.com> Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
committed by
Martin Babinsky
parent
0b8d460191
commit
ba5f7afedc
@@ -23,7 +23,7 @@ import os
|
||||
import sys
|
||||
import logging
|
||||
|
||||
from ipapython.ipa_log_manager import Formatter
|
||||
from ipapython.ipa_log_manager import Formatter, convert_log_level
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
@@ -61,8 +61,10 @@ def pytest_configure(config):
|
||||
capture._capturing.resume_capturing()
|
||||
sys.stdout, sys.stderr = orig_stdout, orig_stderr
|
||||
|
||||
level = convert_log_level(config.getoption('logging_level'))
|
||||
|
||||
handler = LogHandler()
|
||||
handler.setFormatter(Formatter('[%(name)s] %(message)s'))
|
||||
handler.setLevel(config.getoption('logging_level'))
|
||||
handler.setLevel(level)
|
||||
root_logger = logging.getLogger()
|
||||
root_logger.addHandler(handler)
|
||||
|
||||
Reference in New Issue
Block a user