summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaras Voinarovskiy <voyn1991@gmail.com>2017-10-14 09:59:09 +0000
committerTaras Voinarovskiy <voyn1991@gmail.com>2017-10-14 09:59:09 +0000
commit365cae02da59721df77923bb5f5a2d94a84b2e83 (patch)
treec580f76970394728a7b3c3bf6cb956bce1fc56cc
parentd10051bb09942bfd48c6f262a8cdbf5651963c2e (diff)
downloadkafka-python-365cae02da59721df77923bb5f5a2d94a84b2e83.tar.gz
Added limit of 100 bytes for Bytes debug printslegacy_records_refactor
-rw-r--r--kafka/protocol/types.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/kafka/protocol/types.py b/kafka/protocol/types.py
index da10326..c95bd6d 100644
--- a/kafka/protocol/types.py
+++ b/kafka/protocol/types.py
@@ -98,6 +98,10 @@ class Bytes(AbstractType):
raise ValueError('Buffer underrun decoding Bytes')
return value
+ @classmethod
+ def repr(cls, value):
+ return repr(value[:100] + b'...' if len(value) > 100 else b'')
+
class Boolean(AbstractType):
@classmethod