1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-27 01:48:17 +00:00

transport: fit log messages to lines

This commit is contained in:
matejcik 2018-11-08 15:39:20 +01:00
parent 85b85c67b3
commit 93d84539bd

View File

@ -104,24 +104,16 @@ def all_transports() -> Iterable[Type[Transport]]:
def enumerate_devices() -> Iterable[Transport]: def enumerate_devices() -> Iterable[Transport]:
devices = [] # type: List[Transport] devices = [] # type: List[Transport]
for transport in all_transports(): for transport in all_transports():
name = transport.__name__
try: try:
found = transport.enumerate() found = transport.enumerate()
LOG.info( LOG.info("Enumerating {}: found {} devices".format(name, len(found)))
"Enumerating {}: found {} devices".format(
transport.__name__, len(found)
)
)
devices.extend(found) devices.extend(found)
except NotImplementedError: except NotImplementedError:
LOG.error( LOG.error("{} does not implement device enumeration".format(name))
"{} does not implement device enumeration".format(transport.__name__)
)
except Exception as e: except Exception as e:
LOG.error( excname = e.__class__.__name__
"Failed to enumerate {}. {}: {}".format( LOG.error("Failed to enumerate {}. {}: {}".format(name, excname, e))
transport.__name__, e.__class__.__name__, e
)
)
return devices return devices