diff options
author | jardellos <thierry.hardy@orange.com> | 2020-08-28 11:27:47 +0200 |
---|---|---|
committer | Thierry Hardy <thierry.hardy@orange.com> | 2020-08-31 13:49:40 +0200 |
commit | 7664059073dd0691428864deb37c3861521e2cd8 (patch) | |
tree | 8817d8115de3846dee9a5f3a591ecf536e8147d6 /run.py | |
parent | f9b0c349a5c83f9278f6b115d334598201d9d7e6 (diff) |
Add logger in python-sdktests
Adding of logger to onaptests setting the stream and file handlers based
on settings.py
onapsdk should evolve to include the same code
This would avoid to add it in run.py
Simplification of the proposal based on remarks from Michal and Morgan
Issue-ID: TEST-252
Signed-off-by: jardellos <thierry.hardy@orange.com>
Change-Id: I5b7baf77580df916c4f5e62965a47d8462b44c43
Diffstat (limited to 'run.py')
-rw-r--r-- | run.py | 24 |
1 files changed, 9 insertions, 15 deletions
@@ -1,19 +1,13 @@ -import logging +import logging.config +from onapsdk.configuration import settings +from onaptests.steps.instantiate.service_ala_carte import ServiceAlaCarteInstantiateStep -from onaptests.steps.instantiate.vf_module_ala_carte import YamlTemplateVfModuleAlaCarteInstantiateStep - - -# Configure logging -logger = logging.getLogger("") -logger.setLevel(logging.INFO) -fh = logging.StreamHandler() -fh_formatter = logging.Formatter( - "%(asctime)s %(levelname)s %(name)s %(lineno)d:%(filename)s(%(process)d) - %(message)s" -) -fh.setFormatter(fh_formatter) -logger.addHandler(fh) if __name__ == "__main__": - vf_module_inst = YamlTemplateVfModuleAlaCarteInstantiateStep() - vf_module_inst.execute() + # logging configuration for onapsdk, it is not requested for onaptests + # Correction requested in onapsdk to avoid having this duplicate code + logging.config.dictConfig(settings.LOG_CONFIG) + + service_inst = ServiceAlaCarteInstantiateStep() + service_inst.execute() |