mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-03-03 11:45:46 +03:00
Dealing with kb.currentMessage issue
This commit is contained in:
parent
b320dc118d
commit
9bc24cea6b
|
@ -697,21 +697,19 @@ def singleTimeLogMessage(message, level=logging.INFO, flag=None):
|
|||
|
||||
def setColor(message, bold=False):
|
||||
retVal = message
|
||||
level = extractRegexResult(r"\[(?P<result>[A-Z ]+)\]", message)
|
||||
|
||||
if level:
|
||||
kb.currentMessage = level
|
||||
level = extractRegexResult(r"\[(?P<result>[A-Z ]+)\]", message) or kb.get("stickyLevel")
|
||||
|
||||
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))
|
||||
|
||||
elif level:
|
||||
_ = LOGGER_HANDLER.level_map.get(logging.getLevelName(level))
|
||||
if _:
|
||||
background, foreground, bold = _
|
||||
retVal = colored(message, color=foreground, on_color="on_%s" % background if background else None, attrs=("bold",) if bold else None)
|
||||
|
||||
kb.stickyLevel = level if message and message[-1] != "\n" else None
|
||||
|
||||
return retVal
|
||||
|
||||
def dataToStdout(data, forceOutput=False, bold=False):
|
||||
|
|
|
@ -1436,7 +1436,6 @@ def __setKnowledgeBaseAttributes(flushAll=True):
|
|||
|
||||
kb.commonOutputs = None
|
||||
kb.counters = {}
|
||||
kb.currentMessage = None
|
||||
kb.data = AttribDict()
|
||||
kb.dataOutputFlag = False
|
||||
|
||||
|
@ -1511,6 +1510,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
|
|||
kb.singleLogFlags = set()
|
||||
kb.skipOthersDbms = None
|
||||
kb.stickyFlag = False
|
||||
kb.stickyLevel = None
|
||||
kb.suppressResumeInfo = False
|
||||
kb.technique = None
|
||||
kb.testMode = False
|
||||
|
|
Loading…
Reference in New Issue
Block a user