diff --git a/hwilib/devices/jadepy/jade.py b/hwilib/devices/jadepy/jade.py index 4db212163..3ea523c35 100644 --- a/hwilib/devices/jadepy/jade.py +++ b/hwilib/devices/jadepy/jade.py @@ -17,8 +17,8 @@ from .jade_tcp import JadeTCPImpl # 'jade' logger -logger = logging.getLogger('jade') -device_logger = logging.getLogger('jade-device') +logger = logging.getLogger(__name__) +device_logger = logging.getLogger(f'{__name__}-device') # Default serial connection diff --git a/hwilib/devices/jadepy/jade_serial.py b/hwilib/devices/jadepy/jade_serial.py index 0a6fc2be5..615ea0275 100644 --- a/hwilib/devices/jadepy/jade_serial.py +++ b/hwilib/devices/jadepy/jade_serial.py @@ -2,7 +2,7 @@ import logging -logger = logging.getLogger('jade.serial') +logger = logging.getLogger(__name__) # diff --git a/hwilib/devices/jadepy/jade_tcp.py b/hwilib/devices/jadepy/jade_tcp.py index a76d5001d..84d9cc82a 100644 --- a/hwilib/devices/jadepy/jade_tcp.py +++ b/hwilib/devices/jadepy/jade_tcp.py @@ -2,7 +2,7 @@ import logging -logger = logging.getLogger('jade.tcp') +logger = logging.getLogger(__name__) # diff --git a/hwilib/devices/ledger_bitcoin/ledgercomm/log.py b/hwilib/devices/ledger_bitcoin/ledgercomm/log.py index ecfe18127..6fbd23159 100644 --- a/hwilib/devices/ledger_bitcoin/ledgercomm/log.py +++ b/hwilib/devices/ledger_bitcoin/ledgercomm/log.py @@ -2,4 +2,4 @@ import logging -LOG = logging.getLogger("ledgercomm") +LOG = logging.getLogger(__name__.rsplit(".", 1)[0]) diff --git a/hwilib/devices/trezorlib/log.py b/hwilib/devices/trezorlib/log.py index 9cc4a6b9a..6a6c3717c 100644 --- a/hwilib/devices/trezorlib/log.py +++ b/hwilib/devices/trezorlib/log.py @@ -70,6 +70,6 @@ def enable_debug_output( if verbosity > 2: level = DUMP_PACKETS - logger = logging.getLogger("trezorlib") + logger = logging.getLogger(__name__.rsplit(".", 1)[0]) logger.setLevel(level) logger.addHandler(handler) diff --git a/test/authproxy.py b/test/authproxy.py index 4ba6ac1db..950a6f608 100644 --- a/test/authproxy.py +++ b/test/authproxy.py @@ -47,7 +47,7 @@ HTTP_TIMEOUT = 30 USER_AGENT = "AuthServiceProxy/0.1" -log = logging.getLogger("BitcoinRPC") +log = logging.getLogger(__name__) class JSONRPCException(Exception): def __init__(self, rpc_error, http_status=None): diff --git a/test/test_jade.py b/test/test_jade.py index 9670ffee2..9e8e57220 100755 --- a/test/test_jade.py +++ b/test/test_jade.py @@ -31,9 +31,9 @@ # Enable jade logging if LOGGING: - logger = logging.getLogger('jade') + logger = logging.getLogger("hwilib.devices.jadepy.jade") logger.setLevel(LOGGING) - device_logger = logging.getLogger('jade-device') + device_logger = logging.getLogger("hwilib.devices.jadepy.jade-device") device_logger.setLevel(LOGGING) class JadeEmulator(DeviceEmulator):