Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08834531 authored by Zach Johnson's avatar Zach Johnson
Browse files

blueberry: print Data as hex, to make matching to wireshark easier

Bug: 171749953
Tag: #gd-refactor
Test: gd/cert/run --rhost
Change-Id: I25b03d896157451253e2e54bd9c1ee3d23a90286
parent 50e4c1a9
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -17,11 +17,20 @@
import grpc
import re

from facade import common_pb2 as common
from google.protobuf import text_format


def custom_message_formatter(m, ident, as_one_line):
    if m.DESCRIPTOR == common.Data.DESCRIPTOR:
        return 'payload: (hex) "{}"'.format(m.payload.hex())
    return None


def pretty_print(request):
    return '{} {}'.format(type(request).__name__, text_format.MessageToString(request, as_one_line=True))
    return '{} {}'.format(
        type(request).__name__,
        text_format.MessageToString(request, as_one_line=True, message_formatter=custom_message_formatter))


class LoggingRandezvousWrapper():