From f6dea86c28f564115058e6d00cc3fd7da2f85b9d Mon Sep 17 00:00:00 2001 From: CaCO3 Date: Wed, 6 Dec 2023 10:35:47 +0100 Subject: [PATCH] Disable DEBUG logging by default --- buildhat/serinterface.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildhat/serinterface.py b/buildhat/serinterface.py index c8e5063..b964425 100644 --- a/buildhat/serinterface.py +++ b/buildhat/serinterface.py @@ -245,7 +245,7 @@ def checksum(self, data): u = (u ^ data[i]) & 0xFFFFFFFF return u - def write(self, data, log=True, replace=""): + def write(self, data, log=False, replace=""): """Write data to the serial port of Build HAT :param data: Data to write to Build HAT @@ -259,7 +259,7 @@ def write(self, data, log=True, replace=""): else: logging.debug(f"> {data.decode('utf-8', 'ignore').strip()}") - def read(self): + def read(self, log=False): """Read data from the serial port of Build HAT :return: Line that has been read @@ -269,7 +269,7 @@ def read(self): line = self.ser.readline().decode('utf-8', 'ignore').strip() except serial.SerialException: pass - if line != "": + if line != "" and log: logging.debug(f"< {line}") return line