Closed ctrngk closed 4 years ago
Try adding an action=CallPrinter(force_colors=True)
. The defaults are "no tty = no colors".
I do not understand. I redirect to the plain txt file and the color info will be removed. It is not HTML. Do you have a way saving the log file which contains the color info?
Because the output redirection stdout won't have a tty attached thus the tty detection fails. Normally people don't want ansi codes in log files (don't cite me on that tho 😁).
So if you insist in having colored output you use force_colors=True
.
It's like grep output - add another | cat
and match highlighting is usually lost.
I just color the log file in vim, just for easy reading.
To save output to hunter.log
If you are a vim user, you might want to fold hunter.log by syntax "=>" and "<=" in the 3rd column of output. I have written simple vimscript to do this. Simply append the Hunter function to ~/.vimrc
usage: :call Hunter()
Unfortunately the output file is still plain without any color. My hands are tied. Sorry.