summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python/vpp_papi/vpp_papi.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2020-12-02 17:43:59 -0500
committerOle Tr�an <otroan@employees.org>2020-12-03 14:00:05 +0000
commit5395c6a07996b9d852ce1e942bd2b3c094b89d27 (patch)
tree44fe74825728a23d1ac8ff41abdbef8cf910d0c7 /src/vpp-api/python/vpp_papi/vpp_papi.py
parent18a71d8af56f4a70c9257608eb6e71b9cdc9f2ae (diff)
papi: allow client control over loggers
This change enables a client to set debug levels globally as well as individually. exposes loggers as vpp_papi vpp_papi.serializer vpp_papi.transport Type: improvement Change-Id: Ib6bd1a1f552b51a22c9fe3de819a5fb970963ae5 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/vpp-api/python/vpp_papi/vpp_papi.py')
-rw-r--r--src/vpp-api/python/vpp_papi/vpp_papi.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_papi.py b/src/vpp-api/python/vpp_papi/vpp_papi.py
index 1b4df069810..5c375df199d 100644
--- a/src/vpp-api/python/vpp_papi/vpp_papi.py
+++ b/src/vpp-api/python/vpp_papi/vpp_papi.py
@@ -43,7 +43,7 @@ except ModuleNotFoundError:
VppTransport = V
-logger = logging.getLogger(__name__)
+logger = logging.getLogger('vpp_papi')
logger.addHandler(logging.NullHandler())
if sys.version[0] == '2':
@@ -80,7 +80,7 @@ def vpp_atexit(vpp_weakref):
"""Clean up VPP connection on shutdown."""
vpp_instance = vpp_weakref()
if vpp_instance and vpp_instance.transport.connected:
- vpp_instance.logger.debug('Cleaning up VPP on exit')
+ logger.debug('Cleaning up VPP on exit')
vpp_instance.disconnect()
@@ -621,7 +621,7 @@ class VPPApiClient(object):
def decode_incoming_msg(self, msg, no_type_conversion=False):
if not msg:
- self.logger.warning('vpp_api.read failed')
+ logger.warning('vpp_api.read failed')
return
(i, ci), size = self.header.unpack(msg, 0)