aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/features
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-04-27 16:15:37 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-04-27 16:15:37 +0000
commitaab51caef627cb40d78680563d984dd5c1dbbeef (patch)
tree03cc653b135c37fd886a14734476fec2fc10abc8 /testcases/features
parent5506086371536397dc532f2da7ae2bf420c260d6 (diff)
parenta2c96362067e32d569b8a02ca0ec022195e54b35 (diff)
Merge "Replace all the loggers by the functest logger module"
Diffstat (limited to 'testcases/features')
-rw-r--r--testcases/features/doctor.py11
-rw-r--r--testcases/features/promise.py18
2 files changed, 4 insertions, 25 deletions
diff --git a/testcases/features/doctor.py b/testcases/features/doctor.py
index e9ac3df9f..e270f7e97 100644
--- a/testcases/features/doctor.py
+++ b/testcases/features/doctor.py
@@ -14,10 +14,10 @@
#
#
-import logging
import time
import yaml
+import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as functest_utils
with open('/home/opnfv/functest/conf/config_functest.yaml') as f:
@@ -28,14 +28,7 @@ FUNCTEST_REPO = dirs.get('dir_repo_functest')
DOCTOR_REPO = dirs.get('dir_repo_doctor')
TEST_DB_URL = functest_yaml.get('results').get('test_db_url')
-logger = logging.getLogger('doctor')
-logger.setLevel(logging.DEBUG)
-ch = logging.StreamHandler()
-ch.setLevel(logging.DEBUG)
-formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - ' +
- '%(message)s')
-ch.setFormatter(formatter)
-logger.addHandler(ch)
+logger = ft_logger.Logger("doctor").getLogger()
def main():
diff --git a/testcases/features/promise.py b/testcases/features/promise.py
index 179ebca55..804cd6655 100644
--- a/testcases/features/promise.py
+++ b/testcases/features/promise.py
@@ -11,7 +11,6 @@
#
import argparse
import json
-import logging
import os
import requests
import subprocess
@@ -22,6 +21,7 @@ import glanceclient.client as glclient
import novaclient.client as nvclient
from neutronclient.v2_0 import client as ntclient
+import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as functest_utils
import functest.utils.openstack_utils as openstack_utils
@@ -61,21 +61,7 @@ GLANCE_IMAGE_PATH = functest_yaml.get('general').get('directories').get(
'dir_functest_data') + "/" + GLANCE_IMAGE_FILENAME
""" logging configuration """
-logger = logging.getLogger('Promise')
-logger.setLevel(logging.DEBUG)
-
-ch = logging.StreamHandler()
-
-if args.debug:
- ch.setLevel(logging.DEBUG)
-else:
- ch.setLevel(logging.INFO)
-
-formatter = logging.Formatter('%(asctime)s - %(name)s'
- '- %(levelname)s - %(message)s')
-
-ch.setFormatter(formatter)
-logger.addHandler(ch)
+logger = ft_logger.Logger("promise").getLogger()
def main():