[TxMt] Re: Log4j File Syntax Highlighting

Allan Odgaard mailinglist at textmate.org
Sat Sep 15 13:34:28 UTC 2012


On Sep 13, 2012, at 9:36 PM, Kyle Adams (Personal) <adamskf at gmail.com> wrote:

> Is there an existing plugin for log4j file syntax highlighting. I'm looking to highlight all FATAL and ERROR lines in red, WARN in yellow (or something close so that its readable), and INFO in green. 

No idea what already exists, but if you’re using 2.0 then this is a good use-case for injection grammars, see this blog post: http://blog.macromates.com/2012/injection-grammars-project-variables/

Basically you need to create a grammar for your log4j statements (if you know regexp, that shouldn’t take many minutes, see http://manual.macromates.com/en/language_grammars for more info about TextMate grammars).

This grammar can be injected into source.java to give you the new scopes which you can then assign colors to via the theme.



More information about the textmate mailing list