diff options
author | 2017-05-15 07:57:59 +0000 | |
---|---|---|
committer | 2017-05-17 07:59:59 +0000 | |
commit | 93370e86515f9381ec84f9408a2bf900a0ed8689 (patch) | |
tree | 0b74a525babc6f65e616e8d4a9fc9523ec905079 | |
parent | dc24635f0e1cb103c333f8b614a4801341b4f877 (diff) |
Update logger via logging.getLogger()
1. The module functest.utils.functest_logger has been deleted and
logger has been reconfigured in functest [1].
2. Update all related modules to get loggers via logging.getLogger().
[1] https://gerrit.opnfv.org/gerrit/#/c/34019/
JIRA: FUNCTEST-824
Change-Id: I89f5d15342b5f257fbc2700655e255a4e28bd36f
Signed-off-by: Linda Wang <wangwulin@huawei.com>
-rw-r--r-- | sdnvpn/lib/config.py | 4 | ||||
-rw-r--r-- | sdnvpn/lib/quagga.py | 4 | ||||
-rw-r--r-- | sdnvpn/lib/results.py | 4 | ||||
-rw-r--r-- | sdnvpn/lib/utils.py | 4 | ||||
-rw-r--r-- | sdnvpn/test/functest/run_tests.py | 5 | ||||
-rw-r--r-- | sdnvpn/test/functest/tempest.py | 5 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_1.py | 5 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_2.py | 5 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_3.py | 5 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_4.py | 5 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_7.py | 5 | ||||
-rw-r--r-- | sdnvpn/test/functest/testcase_8.py | 5 |
12 files changed, 32 insertions, 24 deletions
diff --git a/sdnvpn/lib/config.py b/sdnvpn/lib/config.py index 52e328d..a54701a 100644 --- a/sdnvpn/lib/config.py +++ b/sdnvpn/lib/config.py @@ -8,13 +8,13 @@ # http://www.apache.org/licenses/LICENSE-2.0 import yaml +import logging import os from functest.utils.constants import CONST -import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as ft_utils -logger = ft_logger.Logger("sndvpn_test_config").getLogger() +logger = logging.getLogger('sdnvpn_test_config') class CommonConfig(object): diff --git a/sdnvpn/lib/quagga.py b/sdnvpn/lib/quagga.py index dc80657..5234189 100644 --- a/sdnvpn/lib/quagga.py +++ b/sdnvpn/lib/quagga.py @@ -1,14 +1,14 @@ """Utilities for setting up quagga peering""" +import logging import re import time -import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as ft_utils import sdnvpn.lib.config as config from sdnvpn.lib.utils import run_odl_cmd, exec_cmd -logger = ft_logger.Logger("sdnvpn-quagga").getLogger() +logger = logging.getLogger('sdnvpn-quagga') COMMON_CONFIG = config.CommonConfig() diff --git a/sdnvpn/lib/results.py b/sdnvpn/lib/results.py index 9f4fd19..aa8dfa6 100644 --- a/sdnvpn/lib/results.py +++ b/sdnvpn/lib/results.py @@ -7,12 +7,12 @@ # # http://www.apache.org/licenses/LICENSE-2.0 # +import logging import time -import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as ft_utils -logger = ft_logger.Logger("sdnvpn-results").getLogger() +logger = logging.getLogger('sdnvpn-results') class Results(object): diff --git a/sdnvpn/lib/utils.py b/sdnvpn/lib/utils.py index 59f641b..f2e65a6 100644 --- a/sdnvpn/lib/utils.py +++ b/sdnvpn/lib/utils.py @@ -7,6 +7,7 @@ # # http://www.apache.org/licenses/LICENSE-2.0 # +import logging import os import sys import time @@ -14,13 +15,12 @@ import requests import re import subprocess -import functest.utils.functest_logger as ft_logger import functest.utils.openstack_utils as os_utils from opnfv.deployment.factory import Factory as DeploymentFactory from sdnvpn.lib import config as sdnvpn_config -logger = ft_logger.Logger("sndvpn_test_utils").getLogger() +logger = logging.getLogger('sndvpn_test_utils') common_config = sdnvpn_config.CommonConfig() diff --git a/sdnvpn/test/functest/run_tests.py b/sdnvpn/test/functest/run_tests.py index 39daf8c..a861a47 100644 --- a/sdnvpn/test/functest/run_tests.py +++ b/sdnvpn/test/functest/run_tests.py @@ -10,18 +10,18 @@ import argparse import importlib +import logging import os import sys import time import traceback import yaml -import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as ft_utils from sdnvpn.lib import config as sdnvpn_config -logger = ft_logger.Logger(__name__).getLogger() +logger = logging.getLogger('sdnvpn-run-tests') COMMON_CONFIG = sdnvpn_config.CommonConfig() TEST_DB_URL = COMMON_CONFIG.test_db @@ -100,6 +100,7 @@ def main(report=False): if __name__ == '__main__': + logging.basicConfig(level=logging.INFO) parser = argparse.ArgumentParser() parser.add_argument("-r", "--report", help="Create json result file", diff --git a/sdnvpn/test/functest/tempest.py b/sdnvpn/test/functest/tempest.py index 728802f..5fca8cb 100644 --- a/sdnvpn/test/functest/tempest.py +++ b/sdnvpn/test/functest/tempest.py @@ -9,14 +9,14 @@ # # import ConfigParser +import logging import os import re import shutil -import functest.utils.functest_logger as ft_logger import functest.opnfv_tests.openstack.tempest.conf_utils as tempest_utils -logger = ft_logger.Logger("sdnvpn-tempest").getLogger() +logger = logging.getLogger('sdnvpn-tempest') def main(): @@ -88,4 +88,5 @@ def main(): if __name__ == '__main__': + logging.basicConfig(level=logging.INFO) main() diff --git a/sdnvpn/test/functest/testcase_1.py b/sdnvpn/test/functest/testcase_1.py index 5aa6411..544d30f 100644 --- a/sdnvpn/test/functest/testcase_1.py +++ b/sdnvpn/test/functest/testcase_1.py @@ -9,9 +9,9 @@ # import argparse +import logging from random import randint -import functest.utils.functest_logger as ft_logger import functest.utils.openstack_utils as os_utils from sdnvpn.lib import utils as test_utils @@ -26,7 +26,7 @@ parser.add_argument("-r", "--report", args = parser.parse_args() -logger = ft_logger.Logger("sdnvpn-testcase-1").getLogger() +logger = logging.getLogger('sdnvpn-testcase-1') COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig('testcase_1') @@ -207,4 +207,5 @@ def main(): if __name__ == '__main__': + logging.basicConfig(level=logging.INFO) main() diff --git a/sdnvpn/test/functest/testcase_2.py b/sdnvpn/test/functest/testcase_2.py index b3481aa..e24cfc0 100644 --- a/sdnvpn/test/functest/testcase_2.py +++ b/sdnvpn/test/functest/testcase_2.py @@ -9,10 +9,10 @@ # import argparse +import logging from random import randint import sys -import functest.utils.functest_logger as ft_logger import functest.utils.openstack_utils as os_utils import sdnvpn.lib.utils as test_utils @@ -27,7 +27,7 @@ parser.add_argument("-r", "--report", args = parser.parse_args() -logger = ft_logger.Logger("sdnvpn-testcase-2").getLogger() +logger = logging.getLogger('sdnvpn-testcase-2') COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig('testcase_2') @@ -247,4 +247,5 @@ def main(): if __name__ == '__main__': + logging.basicConfig(level=logging.INFO) main() diff --git a/sdnvpn/test/functest/testcase_3.py b/sdnvpn/test/functest/testcase_3.py index b9ea74a..b906be6 100644 --- a/sdnvpn/test/functest/testcase_3.py +++ b/sdnvpn/test/functest/testcase_3.py @@ -11,6 +11,7 @@ # - Start a BGP router with OpenDaylight # - Add the functest Quagga as a neighbor # - Verify that the OpenDaylight and gateway Quagga peer +import logging import os import argparse @@ -20,14 +21,13 @@ import sdnvpn.lib.config as sdnvpn_config import functest.utils.openstack_utils as os_utils import functest.utils.functest_utils as ft_utils -import functest.utils.functest_logger as ft_logger from sdnvpn.lib.results import Results COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig("testcase_3") -logger = ft_logger.Logger("sdnvpn-testcase-3").getLogger() +logger = logging.getLogger('sdnvpn-testcase-3') parser = argparse.ArgumentParser() @@ -269,4 +269,5 @@ def main(): if __name__ == '__main__': + logging.basicConfig(level=logging.INFO) main() diff --git a/sdnvpn/test/functest/testcase_4.py b/sdnvpn/test/functest/testcase_4.py index a474630..c91af24 100644 --- a/sdnvpn/test/functest/testcase_4.py +++ b/sdnvpn/test/functest/testcase_4.py @@ -9,9 +9,9 @@ # import argparse +import logging from random import randint -import functest.utils.functest_logger as ft_logger import functest.utils.openstack_utils as os_utils from sdnvpn.lib import utils as test_utils @@ -26,7 +26,7 @@ parser.add_argument("-r", "--report", args = parser.parse_args() -logger = ft_logger.Logger("sdnvpn-testcase-4").getLogger() +logger = logging.getLogger('sdnvpn-testcase-4') COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig('testcase_4') @@ -208,4 +208,5 @@ def main(): if __name__ == '__main__': + logging.basicConfig(level=logging.INFO) main() diff --git a/sdnvpn/test/functest/testcase_7.py b/sdnvpn/test/functest/testcase_7.py index 00e9eef..659f46a 100644 --- a/sdnvpn/test/functest/testcase_7.py +++ b/sdnvpn/test/functest/testcase_7.py @@ -19,8 +19,8 @@ network associated: - Ping it """ import argparse +import logging -import functest.utils.functest_logger as ft_logger import functest.utils.openstack_utils as os_utils from sdnvpn.lib import utils as test_utils @@ -35,7 +35,7 @@ parser.add_argument("-r", "--report", args = parser.parse_args() -logger = ft_logger.Logger("sdnvpn-testcase-7").getLogger() +logger = logging.getLogger('sdnvpn-testcase-7') COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig('testcase_7') @@ -151,4 +151,5 @@ def main(): if __name__ == '__main__': + logging.basicConfig(level=logging.INFO) main() diff --git a/sdnvpn/test/functest/testcase_8.py b/sdnvpn/test/functest/testcase_8.py index f68507e..eca08ec 100644 --- a/sdnvpn/test/functest/testcase_8.py +++ b/sdnvpn/test/functest/testcase_8.py @@ -19,8 +19,8 @@ Test whether router assoc can coexist with floating IP - Ping it the floating ip """ import argparse +import logging -import functest.utils.functest_logger as ft_logger import functest.utils.openstack_utils as os_utils import sdnvpn.lib.utils as test_utils @@ -35,7 +35,7 @@ parser.add_argument("-r", "--report", args = parser.parse_args() -logger = ft_logger.Logger("sdnvpn-testcase-8").getLogger() +logger = logging.getLogger('sdnvpn-testcase-8') COMMON_CONFIG = sdnvpn_config.CommonConfig() TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig('testcase_8') @@ -152,4 +152,5 @@ def main(): if __name__ == '__main__': + logging.basicConfig(level=logging.INFO) main() |