Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable DEBUG logging by default #206

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions buildhat/serinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
Loading