Community
    • Login

    Coloring log files

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 4 Posters 5.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jiongjiongJOJO
      last edited by

      This post is deleted!
      1 Reply Last reply Reply Quote 0
      • J
        jiongjiongJOJO
        last edited by jiongjiongJOJO

        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:
        1712565077964.jpg
        opens within notepad++ like this:
        1712565106229.jpg
        The reference for what I would like to see displayed within notepad++:
        1712565654684.jpg

        Terry RT Alan KilbornA PeterJonesP 3 Replies Last reply Reply Quote 0
        • Terry RT
          Terry R @jiongjiongJOJO
          last edited by Terry R

          @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

          1 Reply Last reply Reply Quote 0
          • Alan KilbornA
            Alan Kilborn @jiongjiongJOJO
            last edited by

            @jiongjiongJOJO

            Really you should have started a new topic with your question. Maybe a moderator could create one and move it?

            1 Reply Last reply Reply Quote 0
            • PeterJonesP
              PeterJones @jiongjiongJOJO
              last edited by PeterJones

              @Alan-Kilborn ,

              Moved.

              @jiongjiongJOJO ,

              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).

              PeterJonesP 1 Reply Last reply Reply Quote 2
              • PeterJonesP
                PeterJones @PeterJones
                last edited by

                @PeterJones said in Coloring log files:

                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.

                v8.1.1 includes the ErrorList higlighting for .log and .err, which allows ANSI escape sequences higlighting, including recognizing and using the ANSI foreground color escape sequences for choosing the foreground color.

                1 Reply Last reply Reply Quote 2
                • First post
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors