From 93d84539bd1189e1b45cf7a83eaf5598e6b99cd1 Mon Sep 17 00:00:00 2001 From: matejcik Date: Thu, 8 Nov 2018 15:39:20 +0100 Subject: [PATCH] transport: fit log messages to lines --- trezorlib/transport/__init__.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/trezorlib/transport/__init__.py b/trezorlib/transport/__init__.py index 6fd54c85b5..df91c28aa8 100644 --- a/trezorlib/transport/__init__.py +++ b/trezorlib/transport/__init__.py @@ -104,24 +104,16 @@ def all_transports() -> Iterable[Type[Transport]]: def enumerate_devices() -> Iterable[Transport]: devices = [] # type: List[Transport] for transport in all_transports(): + name = transport.__name__ try: found = transport.enumerate() - LOG.info( - "Enumerating {}: found {} devices".format( - transport.__name__, len(found) - ) - ) + LOG.info("Enumerating {}: found {} devices".format(name, len(found))) devices.extend(found) except NotImplementedError: - LOG.error( - "{} does not implement device enumeration".format(transport.__name__) - ) + LOG.error("{} does not implement device enumeration".format(name)) except Exception as e: - LOG.error( - "Failed to enumerate {}. {}: {}".format( - transport.__name__, e.__class__.__name__, e - ) - ) + excname = e.__class__.__name__ + LOG.error("Failed to enumerate {}. {}: {}".format(name, excname, e)) return devices