Add named logger

This commit is contained in:
missionfloyd 2021-08-01 17:52:15 -06:00 committed by GitHub
commit 2a10334edc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 286 additions and 208 deletions

View file

@ -32,6 +32,8 @@ import logging
import sys
import time
logger = logging.getLogger(__name__)
class RaspberryPi:
# Pin definition
@ -77,10 +79,10 @@ class RaspberryPi:
return 0
def module_exit(self):
logging.debug("spi end")
logger.debug("spi end")
self.SPI.close()
logging.debug("close 5V, Module enters 0 power consumption ...")
logger.debug("close 5V, Module enters 0 power consumption ...")
self.GPIO.output(self.RST_PIN, 0)
self.GPIO.output(self.DC_PIN, 0)
@ -136,10 +138,10 @@ class JetsonNano:
return 0
def module_exit(self):
logging.debug("spi end")
logger.debug("spi end")
self.SPI.SYSFS_software_spi_end()
logging.debug("close 5V, Module enters 0 power consumption ...")
logger.debug("close 5V, Module enters 0 power consumption ...")
self.GPIO.output(self.RST_PIN, 0)
self.GPIO.output(self.DC_PIN, 0)