From 168502f9fa58d9c348adb563b705d17c5ec4dcf7 Mon Sep 17 00:00:00 2001 From: helenyao Date: Thu, 5 Jan 2017 01:57:01 -0500 Subject: 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 --- functest/ci/logging.json | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 functest/ci/logging.json (limited to 'functest/ci/logging.json') diff --git a/functest/ci/logging.json b/functest/ci/logging.json new file mode 100644 index 000000000..3f454e8fa --- /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" + } + } +} -- cgit 1.2.3-korg