• Login
Community
  • Login

Coloring log files

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 4 Posters 5.1k 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 Apr 8, 2024, 1:39 PM

    This post is deleted!
    1 Reply Last reply Reply Quote 0
    • J
      jiongjiongJOJO
      last edited by jiongjiongJOJO Apr 8, 2024, 8:53 AM Apr 8, 2024, 8:42 AM

      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

      T A P 3 Replies Last reply Apr 8, 2024, 9:45 AM Reply Quote 0
      • T
        Terry R @jiongjiongJOJO
        last edited by Terry R Apr 8, 2024, 9:48 AM Apr 8, 2024, 9:45 AM

        @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
        • A
          Alan Kilborn @jiongjiongJOJO
          last edited by Apr 8, 2024, 11:06 AM

          @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
          • P
            PeterJones @jiongjiongJOJO
            last edited by PeterJones Apr 8, 2024, 2:25 PM Apr 8, 2024, 1:44 PM

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

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