def parseLine(line):
severity = getSeverity(line)
# Add color based on severity
if 'severity' not in locals():
severity = 3
if severity == 0:
color = Style.DIM + Fore.WHITE
elif severity == 1:
color = Style.NORMAL + Fore.BLUE
elif severity == 2:
color = Style.NORMAL + Fore.CYAN
elif severity == 3:
color = Style.NORMAL + Fore.WHITE
elif severity == 4:
color = Style.NORMAL + Fore.RED
elif severity == 5:
color = Style.NORMAL + Fore.BLACK + Back.RED
else:
color = Style.NORMAL + Fore.BLACK + Back.YELLOW
# Replace html tab entity with actual tabs
line = clearTags(line)
line = line.replace('	', "\t")
return color + line + Style.RESET_ALL
评论列表
文章目录