Damian Green - 2013-02-28

Because there are so many .log files out there, from various programs, that have lines that begin with either Error: or Warning: or Info:, a few years ago I created my own syntax highlighting pattern for nedit just for these type of .log files…
I wanted the errors to be red, warnings orange, and info blue, and so I wrote the following:

To your ~/.nedit file, add the following code sections under the corresponding headers:

**nedit.highlightPatterns:
myLog:1:0{\n\
info:"^s*(<Info|info|INFO|I>:?)":"\n\
s*\n\
+|(?=^\\S)"::Info::\n\
info delimeters:"\\1":""::Info_delim:info:C\n\
warning:"^s*(<Warning|warning|WARNING|W>:?)":"\n\
s*\n\
+|(?=^\\S)"::Warning::\n\
warning delimeters:"\\1":""::Warning_delim:warning:C\n\
warning contents:"-+\\&gt;":"(?:(?:(?:(?!^\\S).|\\n)*?\\&lt;-+)|(?:.*(?=(?:.|\\n)*?^\\S)))"::Warning_contents:warning:\n\
error:"^s*(<Error|ERROR|error|E>:?)":"\n\
s*\n\
+|(?=^\\S)"::Error::\n\
error delimeters:"\\1":""::Error_delim:error:C\n\
error contents:"-+\\&gt;":"(?:(?:(?:(?!^\\S).|\\n)*?\\&lt;-+)|(?:.*(?=(?:.|\\n)*?^\\S)))"::Error_contents:error:\n\
waiver:"^s*(<Waiver|WAIVER|Waived|Nixed|N>:?)":"\n\
s*\n\
+|(?=^\\S)"::Waiver::\n\
waiver delimeters:"\\1":""::Waiver_delim:waiver:C\n\
waiver contents:"-+\\&gt;":"(?:(?:(?:(?!^\\S).|\\n)*?\\&lt;-+)|(?:.*(?=(?:.|\\n)*?^\\S)))"::Waiver_contents:waiver:\n\
}\n\

nedit.languageModes:
myLog:.log:::::::\n\

nedit.styles:
Info:steelBlue:Plain\n\
Info_delim:lightBlue:Bold\n\
Warning:darkOrange:Plain\n\
Warning_delim:brown2:Bold\n\
Warning_contents:orange:Plain\n\
Error:Red:Plain\n\
Error_delim:Red:Bold\n\
Error_contents:darkRed:Plain\n\
Waiver:darkGreen:Plain\n\
Waiver_delim:green:Bold\n\
Waiver_contents:limeGreen:Plain

nedit.iSearchLine: True**

That last line is not strictly necessary, but I recommend it to newbies.

Anyway, notice that there are definitions for "Waived:" lines too… You don't have to keep those if you don't want, but I think they are useful, because often I like to post-process log files and insert "Waived: " in front of the "Error: " messages, and I like those to show up green… Keep it, or ditch it; I leave it to you to play around with… Have fun!