Skip to content

Commit

Permalink
chore: add no_color argument into error function
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoGuadrini committed May 13, 2024
1 parent b4dbe60 commit e019be7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,16 @@ def warning(message, nocolor=False):



def error(message):
def error(message, nocolor=False):
"""Print error message in red color
:param message: message to print
:param nocolor: no color message
"""
print("{ansi.red}error: {0}{ansi.reset}".format(message, ansi=ansi))
if nocolor:
print("error: {0}".format(message))
else:
print("{ansi.red}error: {0}{ansi.reset}".format(message, ansi=ansi))


def success(message):
Expand Down

0 comments on commit e019be7

Please sign in to comment.