In _step of logger, the colour remains active after the line is displayed, i.e. it is not reset.
|
return "| " + " | ".join([colour + cells[i] for i in range(len(cells))]) + " |" |
If the user's function has any output or if the system displays any output this will inherit the colour of the last output. This can also potentially cause issues if the user kills the job mid-run leaving the colour code active.
Changing this line to
return "| " + " | ".join([colour + cells[i] + Fore.RESET for i in range(len(cells))]) + " |"
is perhaps a bit "safer" and has the minor advantage of not colouring the | column separators.
On a side note, it would be helpful if the user could:
- Turn off the colouring (if capturing output the escape codes can enter the log file).
- Choose the two colours in use -- for me the default Black is unreadable due to the colour of my terminal background.