From 7664059073dd0691428864deb37c3861521e2cd8 Mon Sep 17 00:00:00 2001 From: jardellos Date: Fri, 28 Aug 2020 11:27:47 +0200 Subject: 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 Change-Id: I5b7baf77580df916c4f5e62965a47d8462b44c43 --- src/onaptests/configuration/settings.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/onaptests/configuration/settings.py') diff --git a/src/onaptests/configuration/settings.py b/src/onaptests/configuration/settings.py index f6959de..0e69b4e 100644 --- a/src/onaptests/configuration/settings.py +++ b/src/onaptests/configuration/settings.py @@ -6,6 +6,38 @@ # # ###################### + +# Variables to set logger information +# Possible values for logging levels in onapsdk: INFO, DEBUG , WARNING, ERROR +LOG_CONFIG = { + "version": 1, + "disable_existing_loggers": False, + "formatters": { + "default": { + "class": "logging.Formatter", + "format": "%(asctime)s %(levelname)s %(lineno)d:%(filename)s(%(process)d) - %(message)s" + } + }, + "handlers": { + "console": { + "level": "DEBUG", + "class": "logging.StreamHandler", + "formatter": "default" + }, + "file": { + "level": "DEBUG", + "class": "logging.FileHandler", + "formatter": "default", + "filename": "./pythonsdk.debug.log", + "mode": "w" + } + }, + "root": { + "level": "DEBUG", + "handlers": ["console", "file"] + } +} + VENDOR_NAME = "sdktests_vendor" VSP_NAME = "sdktests_vsp" VSP_FILE_PATH = "vfw.zip" -- cgit 1.2.3-korg