Skip to content

Commit

Permalink
Log the size of data sent via '_bulk_write()'
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffLIrion committed Nov 26, 2020
1 parent 94f0aea commit 0bd6e11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions adb_shell/adb_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,11 +894,12 @@ def _send(self, msg, adb_info):
Info and settings for this ADB transaction
"""
_LOGGER.debug("bulk_write: %s", repr(msg.pack()))
self._transport.bulk_write(msg.pack(), adb_info.transport_timeout_s)
packed = msg.pack()
_LOGGER.debug("bulk_write(%d): %s", len(packed), repr(packed))
self._transport.bulk_write(packed, adb_info.transport_timeout_s)

if msg.data:
_LOGGER.debug("bulk_write: %s", repr(msg.data))
_LOGGER.debug("bulk_write(%d): %s", len(msg.data), repr(msg.data))
self._transport.bulk_write(msg.data, adb_info.transport_timeout_s)

def _streaming_command(self, service, command, adb_info):
Expand Down
5 changes: 3 additions & 2 deletions adb_shell/adb_device_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,11 +889,12 @@ async def _send(self, msg, adb_info):
Info and settings for this ADB transaction
"""
_LOGGER.debug("bulk_write: %s", repr(msg.pack()))
packed = msg.pack()
_LOGGER.debug("bulk_write(%d): %s", len(packed), repr(packed))
await self._transport.bulk_write(msg.pack(), adb_info.transport_timeout_s)

if msg.data:
_LOGGER.debug("bulk_write: %s", repr(msg.data))
_LOGGER.debug("bulk_write(%d): %s", len(msg.data), repr(msg.data))
await self._transport.bulk_write(msg.data, adb_info.transport_timeout_s)

async def _streaming_command(self, service, command, adb_info):
Expand Down

0 comments on commit 0bd6e11

Please sign in to comment.