Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions buildhat/serinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(self, firmware, signature, version, device="/dev/serial0", debug=Fa
if debug:
tmp = tempfile.NamedTemporaryFile(suffix=".log", prefix="buildhat-", delete=False)
logging.basicConfig(filename=tmp.name, format='%(asctime)s %(message)s',
level=logging.INFO)
level=logging.DEBUG)

for _ in range(4):
self.connections.append(Connection())
Expand Down Expand Up @@ -239,9 +239,9 @@ def write(self, data, log=True, replace=""):
self.ser.write(data)
if not self.fin and log:
if replace != "":
logging.info(f"> {replace}")
logging.debug(f"> {replace}")
else:
logging.info(f"> {data.decode('utf-8', 'ignore').strip()}")
logging.debug(f"> {data.decode('utf-8', 'ignore').strip()}")

def read(self):
"""Read data from the serial port of Build HAT
Expand All @@ -254,7 +254,7 @@ def read(self):
except serial.SerialException:
pass
if line != "":
logging.info(f"< {line}")
logging.debug(f"< {line}")
return line

def shutdown(self):
Expand Down