Skip to content

Commit

Permalink
jadepy: nest loggers following the standard convention
Browse files Browse the repository at this point in the history
  • Loading branch information
fametrano authored and JamieDriver committed Aug 4, 2023
1 parent 59c4877 commit a0c7eff
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion components/assets/gen_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os

# Enable logging
logger = logging.getLogger('gen_assets')
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)


Expand Down
4 changes: 2 additions & 2 deletions jade_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
jadehandler = logging.StreamHandler()
jadehandler.setLevel(logging.INFO)

logger = logging.getLogger('jade')
logger = logging.getLogger('jadepy.jade')
logger.setLevel(logging.DEBUG)
logger.addHandler(jadehandler)

logger = logging.getLogger('jade-device')
logger = logging.getLogger('jadepy.jade-device')
logger.setLevel(logging.DEBUG)
logger.addHandler(jadehandler)

Expand Down
4 changes: 2 additions & 2 deletions jade_capture_image_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
jadehandler = logging.StreamHandler()
jadehandler.setLevel(LOGGING)

logger = logging.getLogger('jade')
logger = logging.getLogger('jadepy.jade')
logger.setLevel(LOGGING)
logger.addHandler(jadehandler)

device_logger = logging.getLogger('jade-device')
device_logger = logging.getLogger('jadepy.jade-device')
device_logger.setLevel(LOGGING)
device_logger.addHandler(jadehandler)

Expand Down
4 changes: 2 additions & 2 deletions jade_ota.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
# Enable jade debug logging
jadehandler = logging.StreamHandler()

logger = logging.getLogger('jade')
logger = logging.getLogger('jadepy.jade')
logger.setLevel(logging.DEBUG)
logger.addHandler(jadehandler)

device_logger = logging.getLogger('jade-device')
device_logger = logging.getLogger('jadepy.jade-device')
device_logger.setLevel(logging.DEBUG)
device_logger.addHandler(jadehandler)

Expand Down
4 changes: 2 additions & 2 deletions 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')

# BLE comms backend is optional
# It relies on the BLE dependencies being available
Expand Down
2 changes: 1 addition & 1 deletion jadepy/jade_ble.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from .jade_error import JadeError

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


#
Expand Down
2 changes: 1 addition & 1 deletion jadepy/jade_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from serial.tools import list_ports

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


#
Expand Down
2 changes: 1 addition & 1 deletion 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
4 changes: 2 additions & 2 deletions set_jade_pinserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
# Enable jade logging
jadehandler = logging.StreamHandler()

logger = logging.getLogger('jade')
logger = logging.getLogger('jadepy.jade')
logger.setLevel(logging.INFO)
logger.addHandler(jadehandler)

device_logger = logging.getLogger('jade-device')
device_logger = logging.getLogger('jadepy.jade-device')
device_logger.setLevel(logging.INFO)
device_logger.addHandler(jadehandler)

Expand Down
4 changes: 2 additions & 2 deletions test_jade.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
# Enable jade logging
jadehandler = logging.StreamHandler()

logger = logging.getLogger('jade')
logger = logging.getLogger('jadepy.jade')
logger.setLevel(logging.DEBUG)
logger.addHandler(jadehandler)

device_logger = logging.getLogger('jade-device')
device_logger = logging.getLogger('jadepy.jade-device')
device_logger.setLevel(logging.DEBUG)
device_logger.addHandler(jadehandler)

Expand Down
2 changes: 1 addition & 1 deletion tools/fwprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import fwtools

# Enable logging
logger = logging.getLogger('jade')
logger = logging.getLogger('jadepy.jade')
logger.setLevel(logging.INFO)


Expand Down
2 changes: 1 addition & 1 deletion tools/fwtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
FWFILE_TYPE_HASH = 'fw.bin.hash'
FWFILE_TYPE_PATCH = 'patch.bin'

logger = logging.getLogger('jade')
logger = logging.getLogger('jadepy.jade')


# Prefix a directory to an existing filename/path
Expand Down
2 changes: 1 addition & 1 deletion tools/mkindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import fwtools

# Enable logging
logger = logging.getLogger('jade')
logger = logging.getLogger('jadepy.jade')
logger.setLevel(logging.INFO)

INDEX_FILENAME = 'index.json'
Expand Down
2 changes: 1 addition & 1 deletion tools/mkpatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import fwtools

# Enable logging
logger = logging.getLogger('jade')
logger = logging.getLogger('jadepy.jade')
logger.setLevel(logging.INFO)


Expand Down
4 changes: 2 additions & 2 deletions update_jade_fw.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

# Enable jade logging
jadehandler = logging.StreamHandler()
logger = logging.getLogger('jade')
logger = logging.getLogger('jadepy.jade')
logger.setLevel(logging.DEBUG)
logger.addHandler(jadehandler)
device_logger = logging.getLogger('jade-device')
device_logger = logging.getLogger('jadepy.jade-device')
device_logger.setLevel(logging.DEBUG)
device_logger.addHandler(jadehandler)

Expand Down

0 comments on commit a0c7eff

Please sign in to comment.