Skip to content

Commit

Permalink
Fix no color issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackndo committed Jun 30, 2022
1 parent ecd5fda commit ec193c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lsassy/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def highlight(msg):
:param msg: Message to highlight
:return: Highlighted message
"""
if logging.getFormatter().no_color:
if logging.no_color:
return msg
return "\033[1;33m{}\033[0m".format(msg)

Expand All @@ -66,4 +66,5 @@ def init(quiet=False, no_color=False):

logging.addLevelName(25, 'SUCCESS')
setattr(logging, 'success', lambda message, *args: logging.getLogger()._log(25, message, args))
setattr(logging, 'no_color', no_color)
logging.getLogger().disabled = quiet

0 comments on commit ec193c0

Please sign in to comment.