Skip to content

Commit

Permalink
Merge #697: nest loggers in the proper way
Browse files Browse the repository at this point in the history
75af80b present naming preference (without trailing .log) (fametrano)
324b88e nest loggers in the proper way (fametrano)

Pull request description:

  see also:

  - Blockstream/Jade#78
  - LedgerHQ/ledgercomm#16
  - trezor/trezor-firmware#3190

ACKs for top commit:
  achow101:
    ACK 75af80b

Tree-SHA512: 2044b39680e2683fa0a25d9f50f66f8b204fc0b5685c032caef3ccd36cc255e10ce1676902e82a75d4fc7cacb5ea7b5de51a6839f46de4cc64a5010adf76c712
  • Loading branch information
achow101 committed Aug 16, 2023
2 parents 5242d85 + 75af80b commit 0462cfc
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions hwilib/devices/jadepy/jade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hwilib/devices/jadepy/jade_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging


logger = logging.getLogger('jade.serial')
logger = logging.getLogger(__name__)


#
Expand Down
2 changes: 1 addition & 1 deletion hwilib/devices/jadepy/jade_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging


logger = logging.getLogger('jade.tcp')
logger = logging.getLogger(__name__)


#
Expand Down
2 changes: 1 addition & 1 deletion hwilib/devices/ledger_bitcoin/ledgercomm/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

import logging

LOG = logging.getLogger("ledgercomm")
LOG = logging.getLogger(__name__.rsplit(".", 1)[0])
2 changes: 1 addition & 1 deletion hwilib/devices/trezorlib/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion test/authproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions test/test_jade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 0462cfc

Please sign in to comment.