Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    UDL Documentation and how to define a Language to highlight Log files

    Help wanted · · · – – – · · ·
    2
    2
    2662
    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.
    • Chris Swinney
      Chris Swinney last edited by

      Hi All,

      I’ve been reading what documentation I can find with regard the the UDL, however, this doesn’t really show me what I want

      http://docs.notepad-plus-plus.org/index.php/User_Defined_Languages
      http://udl20.weebly.com/

      I don’t really want to define a syntax highlighting for a programming language, but rather to highlight lines were some text in the line matches a keyword in some log files, for example:

      • 2016-03-10T08:18:27.415+00:00 node 2016-03-10 08:18:27,415 Level=“ERROR” Name=“administrator.system.connectivity” Message=“Connectivity lost to node.”
      • 2016-03-10T08:19:40.825+00:00 node 2016-03-10 08:19:40,825 Level=“WARNING” Name=“administrator.system.configuration” Message=“Conferencing node appears unavailable.”
      • 2016-03-10T08:21:03.755+00:00 node 2016-03-10 08:21:03,755 Level=“INFO” Name=“administrator.gatewayroutingrulematcher” Message=“Alias matched gateway rule”

      The log entries have Keywords within them call “ERROR”, “WARNING” and “INFO”, but try as I might, I cannot seem to get the lines to automatically highlight. I also have tried to install a previously created Language called “Log4Net” from http://docs.notepad-plus-plus.org/index.php/User_Defined_Language_Files, and whilst this has define similar keywords, this too fails.

      Basically, I’m looking to see if I can get the line to stand out, i.e. Red text on yellow background for an Error, etc.

      How on earth can I achieve this?

      Cheers

      Claudia Frank 1 Reply Last reply Reply Quote 0
      • Claudia Frank
        Claudia Frank @Chris Swinney last edited by

        Hello @Chris-Swinney,

        I’m not sure if you can do this with UDL properly as it is designed to act on words rather than lines.
        If it is sufficient then define the keywords ERROR, WARNING with the foreground and background color
        of your choice and define a double quote delimiter for open and close. Press style and allow nesting
        with your keywords.

        If this isn’t what you are looking for, then the other alternative I now would be using a python script
        to color the the lines.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors