mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 09:36:35 +03:00
Minor fix (recognizing if it's colorizing handler or not)
This commit is contained in:
parent
cba2a26b68
commit
b320dc118d
|
@ -702,14 +702,15 @@ def setColor(message, bold=False):
|
|||
if level:
|
||||
kb.currentMessage = level
|
||||
|
||||
if bold:
|
||||
retVal = colored(message, color=None, on_color=None, attrs=("bold",))
|
||||
elif hasattr(LOGGER_HANDLER, "level_map") and hasattr(kb, "currentMessage") and kb.currentMessage:
|
||||
_ = LOGGER_HANDLER.level_map.get(logging.getLevelName(kb.currentMessage))
|
||||
if hasattr(LOGGER_HANDLER, "level_map"): # colorizing handler
|
||||
if bold:
|
||||
retVal = colored(message, color=None, on_color=None, attrs=("bold",))
|
||||
elif hasattr(kb, "currentMessage") and kb.currentMessage:
|
||||
_ = LOGGER_HANDLER.level_map.get(logging.getLevelName(kb.currentMessage))
|
||||
|
||||
if _:
|
||||
background, foreground, bold = _
|
||||
retVal = colored(message, color=foreground, on_color="on_%s" % background if background else None, attrs=("bold",) if bold else None)
|
||||
if _:
|
||||
background, foreground, bold = _
|
||||
retVal = colored(message, color=foreground, on_color="on_%s" % background if background else None, attrs=("bold",) if bold else None)
|
||||
|
||||
return retVal
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user