From d1c05f22d8ce8bea4039cdd77e90d525699953d0 Mon Sep 17 00:00:00 2001 From: Alex <12754559+a1ex4@users.noreply.github.com> Date: Sat, 7 Sep 2024 14:32:51 +0200 Subject: [PATCH] Print: configure levels to print actually taken into account (#8) --- py/nstools/nut/Print.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/py/nstools/nut/Print.py b/py/nstools/nut/Print.py index e42ed081..f8d1d77f 100644 --- a/py/nstools/nut/Print.py +++ b/py/nstools/nut/Print.py @@ -10,6 +10,9 @@ silent = False def info(s, pleaseNoPrint = None): + if silent or not enableInfo: + return + if pleaseNoPrint == None: sys.stdout.write(s + "\n") else: @@ -22,13 +25,21 @@ def info(s, pleaseNoPrint = None): pleaseNoPrint.decrement() def infoNoNewline(s): + if silent or not enableInfo: + return sys.stdout.write(s) def error(s): + if silent or not enableError: + return sys.stdout.write(s + "\n") def warning(s): + if silent or not enableWarning: + return sys.stdout.write(s + "\n") def debug(s): + if silent or not enableWarning: + return sys.stdout.write(s + "\n")