Coloring log files
-
This post is deleted! -
Can you support parsing and displaying different color strings My log file contains color characters, but it seems that it can only be displayed in the terminal, and plain text can’t be displayed directly, but I noticed that notepad++ has a formatting feature, which I think can be parsed by parsing the corresponding characters or by a related plugin. Here’s what my log says:
opens within notepad++ like this:
The reference for what I would like to see displayed within notepad++:
-
@jiongjiongJOJO
Perhaps your log file is very large. By default Notepad++ will not highlight text in files over 200MB, see the online user manual reference here. This value is configurable in 8.4.7 or better.To see if this a problem, copy a small portion of the log file and use Notepad++ to see if it starts to highlight. There may also be other factors affecting highlighting. Notepad++ tries to determine the file content type from the first line, or even the file extension, so possibly also look into that.
Best to read the link I provided, much more information is available.
Terry
-
Really you should have started a new topic with your question. Maybe a moderator could create one and move it?
-
Moved.
It looks to me like you want Notepad++ to display your logfile which uses ANSI ESCAPE SEQUENCES in the colors that those ANSI escape sequences define.
Just so you know, Notepad++ is a text editor with syntax highlighting, it is not a rendering engine. Its goal is to show you the underlying text (or bytes, if they aren’t valid text, like ANSI escape sequences are not). Thus, what you showed with the real Notepad++ is the correct behavior. (This is the same reason Notepad++ shows the raw HTML, not a rendered webpage, when you are editing an HTML file. It is an editor, not a renderer/viewer.)
However, I do seem to remember that there have been other discussions about this, and there’s either a plugin that does it or someone has shared a PythonScript solution which will interpret those ANSI escape sequences and use Notepad++ syntax highlighting to add in the colors that they define… but I don’t remember exactly, so you might want to search the forum for
ANSI escape sequences
or similar phrases.update: yeah, I think “ANSI escape sequences color rendering” is what I was thinking of. It shows how to use a UDL plus the EnhanceAnyLexer plugin to get it to render colors (but will still show the escape sequences, because that’s how one could edit such a file).