aboutsummaryrefslogtreecommitdiffstats
path: root/functest/ci
diff options
context:
space:
mode:
authorhelenyao <yaohelan@huawei.com>2017-01-05 01:57:01 -0500
committerhelenyao <yaohelan@huawei.com>2017-01-19 04:36:48 -0500
commit168502f9fa58d9c348adb563b705d17c5ec4dcf7 (patch)
tree2469a15f448beacbc7059eb719a4225d06623da0 /functest/ci
parent34aab533f4a6c20676eb2a2b6843d5980ea3ac17 (diff)
Leverage logging config and refactor the logger
JIRA: FUNCTEST-690 The detailed benefits are listed in the JIRA description. 1. Refactored the functest_logger to make use of configuration file 2. Avoided configuring the logging every time a logger is initialized 3. Applied separate logging configuration fo unit test by removing saving log to file Change-Id: I6e27eaba727ae6d704f0301f15359dc3ea7b2f97 Signed-off-by: helenyao <yaohelan@huawei.com>
Diffstat (limited to 'functest/ci')
-rwxr-xr-xfunctest/ci/config_functest.yaml1
-rw-r--r--functest/ci/logging.json29
2 files changed, 30 insertions, 0 deletions
diff --git a/functest/ci/config_functest.yaml b/functest/ci/config_functest.yaml
index 25be1724..f1efd904 100755
--- a/functest/ci/config_functest.yaml
+++ b/functest/ci/config_functest.yaml
@@ -30,6 +30,7 @@ general:
functest: /home/opnfv/functest
functest_test: /home/opnfv/repos/functest/functest/opnfv_tests
results: /home/opnfv/functest/results
+ functest_logging_cfg: /home/opnfv/repos/functest/functest/ci/logging.json
functest_conf: /home/opnfv/functest/conf
functest_data: /home/opnfv/functest/data
dir_vIMS_data: /home/opnfv/functest/data/vIMS/
diff --git a/functest/ci/logging.json b/functest/ci/logging.json
new file mode 100644
index 00000000..3f454e8f
--- /dev/null
+++ b/functest/ci/logging.json
@@ -0,0 +1,29 @@
+{
+ "version": 1,
+ "disable_existing_loggers": false,
+ "formatters": {
+ "standard": {
+ "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
+ }
+ },
+ "handlers": {
+ "console": {
+ "level": "INFO",
+ "class": "logging.StreamHandler",
+ "formatter": "standard"
+ },
+ "file": {
+ "level": "DEBUG",
+ "class": "logging.FileHandler",
+ "formatter": "standard",
+ "filename": "/home/opnfv/functest/results/functest.log"
+ }
+ },
+ "loggers": {
+ "": {
+ "handlers": ["console", "file"],
+ "level": "DEBUG",
+ "propagate": "yes"
+ }
+ }
+}