mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-25 16:08:32 +00:00
log: remove special handling of Features/CoinType in prettyprinter
now that Trezor won't send CoinTypes anymore
This commit is contained in:
parent
99bc267301
commit
aace6577c8
@ -18,7 +18,7 @@ class PrettyProtobufFormatter(logging.Formatter):
|
|||||||
if type(record.protobuf) in OMITTED_MESSAGES:
|
if type(record.protobuf) in OMITTED_MESSAGES:
|
||||||
message += " ({} bytes)".format(record.protobuf.ByteSize())
|
message += " ({} bytes)".format(record.protobuf.ByteSize())
|
||||||
else:
|
else:
|
||||||
message += "\n" + protobuf.format_message(record.protobuf, collapse_cointypes=True)
|
message += "\n" + protobuf.format_message(record.protobuf)
|
||||||
return message
|
return message
|
||||||
|
|
||||||
|
|
||||||
|
@ -352,8 +352,7 @@ def format_message(pb: MessageType,
|
|||||||
indent: int = 0,
|
indent: int = 0,
|
||||||
sep: str = ' ' * 4,
|
sep: str = ' ' * 4,
|
||||||
truncate_after: Optional[int] = 256,
|
truncate_after: Optional[int] = 256,
|
||||||
truncate_to: Optional[int] = 64,
|
truncate_to: Optional[int] = 64) -> str:
|
||||||
collapse_cointypes: bool = False) -> str:
|
|
||||||
|
|
||||||
def mostly_printable(bytes):
|
def mostly_printable(bytes):
|
||||||
if not bytes:
|
if not bytes:
|
||||||
@ -397,14 +396,8 @@ def format_message(pb: MessageType,
|
|||||||
|
|
||||||
return repr(value)
|
return repr(value)
|
||||||
|
|
||||||
from .messages import Features
|
|
||||||
pb_dict = pb.__dict__.copy()
|
|
||||||
if collapse_cointypes and isinstance(pb, Features):
|
|
||||||
del pb_dict['coins']
|
|
||||||
pb_dict['coins (shortened)'] = ' '.join(coin.coin_shortcut for coin in pb.coins)
|
|
||||||
|
|
||||||
return '{name} ({size} bytes) {content}'.format(
|
return '{name} ({size} bytes) {content}'.format(
|
||||||
name=pb.__class__.__name__,
|
name=pb.__class__.__name__,
|
||||||
size=pb.ByteSize(),
|
size=pb.ByteSize(),
|
||||||
content=pformat_value(pb_dict, indent)
|
content=pformat_value(pb.__dict__, indent)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user