diff options
author | Cole Robinson <crobinso@redhat.com> | 2019-07-16 16:36:31 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2019-07-16 16:53:22 -0400 |
commit | f4d62660f1e9141d551374ffeac0548a2505d390 (patch) | |
tree | 678ba204621598fd879fe50389ac263a9b0d178a /tests | |
parent | 0df8577e11be1489c5e422a293a164f2c2b024f4 (diff) | |
download | virt-manager-f4d62660f1e9141d551374ffeac0548a2505d390.tar.gz |
tests: Don't use the root logger
Stops logging spam from requests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/__init__.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/__init__.py b/tests/__init__.py index 259992de..609d7d8c 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -32,13 +32,15 @@ def setup_logging(): for handler in rootLogger.handlers: rootLogger.removeHandler(handler) - logging.basicConfig(level=logging.DEBUG, - format="%(levelname)-8s %(message)s") - + fmt = "%(levelname)-8s %(message)s" + streamHandler = logging.StreamHandler() + streamHandler.setFormatter(logging.Formatter(fmt)) if utils.clistate.debug: - rootLogger.setLevel(logging.DEBUG) + streamHandler.setLevel(logging.DEBUG) else: - rootLogger.setLevel(logging.ERROR) + streamHandler.setLevel(logging.ERROR) + log.addHandler(streamHandler) + log.setLevel(logging.DEBUG) def setup_cli_imports(): |