Skip to content

Commit

Permalink
Print: configure levels to print actually taken into account (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
a1ex4 authored Sep 7, 2024
1 parent e00c4c0 commit d1c05f2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions py/nstools/nut/Print.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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")

0 comments on commit d1c05f2

Please sign in to comment.