mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 11:03:47 +03:00
Fix for an Issue #140
This commit is contained in:
parent
fec8a5cc9d
commit
31ceb0cb6c
|
@ -701,7 +701,7 @@ def setColor(message, bold=False):
|
|||
retVal = message
|
||||
level = extractRegexResult(r"\[(?P<result>[A-Z ]+)\]", message) or kb.get("stickyLevel")
|
||||
|
||||
if message and hasattr(LOGGER_HANDLER, "level_map"): # colorizing handler
|
||||
if message and getattr(LOGGER_HANDLER, "is_tty", False): # colorizing handler
|
||||
if bold:
|
||||
retVal = colored(message, color=None, on_color=None, attrs=("bold",))
|
||||
elif level:
|
||||
|
|
4
thirdparty/ansistrm/ansistrm.py
vendored
4
thirdparty/ansistrm/ansistrm.py
vendored
|
@ -51,6 +51,8 @@ class ColorizingStreamHandler(logging.StreamHandler):
|
|||
stream = self.stream
|
||||
|
||||
if not self.is_tty:
|
||||
if message and message[0] == "\r":
|
||||
message = message[1:]
|
||||
stream.write(message)
|
||||
else:
|
||||
self.output_colorized(message)
|
||||
|
@ -122,7 +124,7 @@ class ColorizingStreamHandler(logging.StreamHandler):
|
|||
ctypes.windll.kernel32.SetConsoleTextAttribute(h, color)
|
||||
|
||||
def colorize(self, message, record):
|
||||
if record.levelno in self.level_map:
|
||||
if record.levelno in self.level_map and self.is_tty:
|
||||
bg, fg, bold = self.level_map[record.levelno]
|
||||
params = []
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user