Leverage on DEBUG env var 06/67706/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Thu, 25 Apr 2019 12:32:12 +0000 (14:32 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Thu, 25 Apr 2019 19:13:19 +0000 (21:13 +0200)
It allows muting debug logs.

Change-Id: I291f3bb7e0a450724a34997c720bde01f72c8e50
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit d777f2e588a321d5c01e2e50ffa5c8fc5a27c77c)

docker/core/Dockerfile
functest/ci/logging.debug.ini [new file with mode: 0644]
functest/ci/logging.ini
functest/utils/env.py
upper-constraints.txt

index 5ba41a2..728ae6d 100644 (file)
@@ -28,6 +28,7 @@ RUN apk --no-cache add --update \
         /src/functest && \
     rm -r upper-constraints.opnfv.txt /src/functest && \
     cp /usr/lib/python2.7/site-packages/functest/ci/logging.ini /usr/lib/python2.7/site-packages/xtesting/ci/ && \
+    cp /usr/lib/python2.7/site-packages/functest/ci/logging.debug.ini /usr/lib/python2.7/site-packages/xtesting/ci/ && \
     bash -c "mkdir -p /var/lib/xtesting /home/opnfv" && \
     ln -s /var/lib/xtesting /home/opnfv/functest && \
     bash -c "mkdir -p /home/opnfv/functest{/conf,/data,/images,/results} /home/opnfv/repos/vnfs" && \
diff --git a/functest/ci/logging.debug.ini b/functest/ci/logging.debug.ini
new file mode 100644 (file)
index 0000000..51ee359
--- /dev/null
@@ -0,0 +1,115 @@
+[loggers]
+keys=root,functest,api,ci,core,cli,opnfv_tests,utils,xtesting,xci,xcore,energy,xutils,sfc,baro,warnings
+
+[handlers]
+keys=console,wconsole,file,dfile
+
+[formatters]
+keys=standard
+
+[logger_root]
+level=NOTSET
+handlers=dfile
+
+[logger_functest]
+level=NOTSET
+handlers=file
+qualname=functest
+
+[logger_api]
+level=NOTSET
+handlers=wconsole
+qualname=functest.api
+
+[logger_ci]
+level=NOTSET
+handlers=console
+qualname=functest.ci
+
+[logger_core]
+level=NOTSET
+handlers=console
+qualname=functest.core
+
+[logger_cli]
+level=NOTSET
+handlers=wconsole
+qualname=functest.cli
+
+[logger_opnfv_tests]
+level=NOTSET
+handlers=wconsole
+qualname=functest.opnfv_tests
+
+[logger_utils]
+level=NOTSET
+handlers=wconsole
+qualname=functest.utils
+
+[logger_xtesting]
+level=NOTSET
+handlers=file
+qualname=xtesting
+
+[logger_xci]
+level=NOTSET
+handlers=console
+qualname=xtesting.ci
+
+[logger_xcore]
+level=NOTSET
+handlers=console
+qualname=xtesting.core
+
+[logger_energy]
+level=NOTSET
+handlers=wconsole
+qualname=xtesting.energy
+
+[logger_xutils]
+level=NOTSET
+handlers=wconsole
+qualname=xtesting.utils
+
+[logger_sfc]
+level=NOTSET
+handlers=file,wconsole
+qualname=sfc
+
+[logger_baro]
+level=NOTSET
+handlers=file,wconsole
+qualname=baro_tests
+
+[logger_warnings]
+level=NOTSET
+handlers=file,console
+qualname=py.warnings
+
+[handler_console]
+class=StreamHandler
+level=INFO
+formatter=standard
+args=(sys.stdout,)
+
+[handler_wconsole]
+class=StreamHandler
+level=WARN
+formatter=standard
+args=(sys.stdout,)
+
+[handler_file]
+class=FileHandler
+level=DEBUG
+formatter=standard
+args=("/home/opnfv/functest/results/functest.log",)
+
+[handler_dfile]
+class=FileHandler
+level=DEBUG
+formatter=standard
+args=("/home/opnfv/functest/results/functest.debug.log",)
+
+[formatter_standard]
+format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
+datefmt=
index 51ee359..278529e 100644 (file)
@@ -2,14 +2,14 @@
 keys=root,functest,api,ci,core,cli,opnfv_tests,utils,xtesting,xci,xcore,energy,xutils,sfc,baro,warnings
 
 [handlers]
-keys=console,wconsole,file,dfile
+keys=console,wconsole,file,null
 
 [formatters]
 keys=standard
 
 [logger_root]
 level=NOTSET
-handlers=dfile
+handlers=null
 
 [logger_functest]
 level=NOTSET
@@ -86,6 +86,12 @@ level=NOTSET
 handlers=file,console
 qualname=py.warnings
 
+[handler_null]
+class=NullHandler
+level=NOTSET
+formatter=standard
+args=()
+
 [handler_console]
 class=StreamHandler
 level=INFO
@@ -104,12 +110,6 @@ level=DEBUG
 formatter=standard
 args=("/home/opnfv/functest/results/functest.log",)
 
-[handler_dfile]
-class=FileHandler
-level=DEBUG
-formatter=standard
-args=("/home/opnfv/functest/results/functest.debug.log",)
-
 [formatter_standard]
 format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
 datefmt=
index e202f45..c761f30 100644 (file)
@@ -17,6 +17,7 @@ from xtesting.utils import env
 INPUTS = {
     'EXTERNAL_NETWORK': None,
     'CI_LOOP': env.INPUTS['CI_LOOP'],
+    'DEBUG': env.INPUTS['DEBUG'],
     'DEPLOY_SCENARIO': env.INPUTS['DEPLOY_SCENARIO'],
     'INSTALLER_TYPE': env.INPUTS['INSTALLER_TYPE'],
     'SDN_CONTROLLER_IP': None,
index 279683b..a9a45d7 100644 (file)
@@ -15,7 +15,7 @@ robotframework-httplibrary===0.4.2
 robotframework-requests===0.4.7
 robotframework-sshlibrary===2.1.3;python_version=='2.7'
 ansible===2.3.2.0
-xtesting===0.61.0
+xtesting===0.62.0
 networking-bgpvpn===9.0.0
 networking-sfc===7.0.0
 neutron===13.0.2