mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 19:13:48 +03:00
restored kb.currentMessage - needed in cases where we send to dataToStdout() strings like "." (e.g. "creation in progres ..... done")
This commit is contained in:
parent
2b3ea3e3b7
commit
247f95e051
|
@ -697,10 +697,13 @@ def singleTimeLogMessage(message, level=logging.INFO, flag=None):
|
|||
|
||||
def setColor(message, bold=False):
|
||||
retVal = message
|
||||
level = extractRegexResult(r"\A\s*\[(?P<result>[A-Z ]+)\]", message)
|
||||
level = extractRegexResult(r"\[(?P<result>[A-Z ]+)\]", message)
|
||||
|
||||
if hasattr(LOGGER_HANDLER, "level_map"):
|
||||
_ = LOGGER_HANDLER.level_map.get(logging.getLevelName(level))
|
||||
if level:
|
||||
kb.currentMessage = level
|
||||
|
||||
if hasattr(LOGGER_HANDLER, "level_map") and 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)
|
||||
|
|
|
@ -1436,6 +1436,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
|
|||
|
||||
kb.commonOutputs = None
|
||||
kb.counters = {}
|
||||
kb.currentMessage = None
|
||||
kb.data = AttribDict()
|
||||
kb.dataOutputFlag = False
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user