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:
parent
85b85c67b3
commit
93d84539bd
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user