papi: truncate long logger messages 63/22463/2
authorKlement Sekera <[email protected]>
Thu, 12 Sep 2019 09:01:06 +0000 (09:01 +0000)
committerAndrew Yourtchenko <[email protected]>
Thu, 3 Oct 2019 08:42:41 +0000 (08:42 +0000)
Dumping whole cli_inband output causes huge unformatted messages written
to logger, so truncate these to avoid that.

Type: fix

Change-Id: I59565a98e3595cbfe4971cc346e104cb198d8f24
Signed-off-by: Klement Sekera <[email protected]>
(cherry picked from commit 5e2f84d2cf97a6efa89c1c4bbf80de6a8f03d2a8)

src/vpp-api/python/vpp_papi/vpp_papi.py

index 84a3e51..f09f6e0 100644 (file)
@@ -665,7 +665,10 @@ class VPPApiClient(object):
 
         self.transport.resume()
 
-        self.logger.debug('Return from {!r}'.format(r))
+        s = 'Return value: {!r}'.format(r)
+        if len(s) > 80:
+            s = s[:80] + "..."
+        self.logger.debug(s)
         return rl
 
     def _call_vpp_async(self, i, msg, **kwargs):