Show more relevant information when DEBUG logs are enabled

Show exactly what is being sent and received
This commit is contained in:
Dan 2020-06-02 13:05:26 +02:00
parent d82e9468f0
commit 7df85e2039

View File

@ -286,7 +286,7 @@ class Session:
else [data] else [data]
) )
log.debug(data) log.debug("Received:\n{}".format(data))
for msg in messages: for msg in messages:
if msg.seq_no % 2 != 0: if msg.seq_no % 2 != 0:
@ -406,6 +406,8 @@ class Session:
if wait_response: if wait_response:
self.results[msg_id] = Result() self.results[msg_id] = Result()
log.debug("Sent:\n{}".format(message))
payload = self.pack(message) payload = self.pack(message)
try: try: