Skip to content

Commit 2d84f52

Browse files
authored
Use debug logging level (#159)
1 parent efe5557 commit 2d84f52

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

buildhat/serinterface.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def __init__(self, firmware, signature, version, device="/dev/serial0", debug=Fa
9494
if debug:
9595
tmp = tempfile.NamedTemporaryFile(suffix=".log", prefix="buildhat-", delete=False)
9696
logging.basicConfig(filename=tmp.name, format='%(asctime)s %(message)s',
97-
level=logging.INFO)
97+
level=logging.DEBUG)
9898

9999
for _ in range(4):
100100
self.connections.append(Connection())
@@ -239,9 +239,9 @@ def write(self, data, log=True, replace=""):
239239
self.ser.write(data)
240240
if not self.fin and log:
241241
if replace != "":
242-
logging.info(f"> {replace}")
242+
logging.debug(f"> {replace}")
243243
else:
244-
logging.info(f"> {data.decode('utf-8', 'ignore').strip()}")
244+
logging.debug(f"> {data.decode('utf-8', 'ignore').strip()}")
245245

246246
def read(self):
247247
"""Read data from the serial port of Build HAT
@@ -254,7 +254,7 @@ def read(self):
254254
except serial.SerialException:
255255
pass
256256
if line != "":
257-
logging.info(f"< {line}")
257+
logging.debug(f"< {line}")
258258
return line
259259

260260
def shutdown(self):

0 commit comments

Comments
 (0)