How to highlight errors and warnings on iTerm terminal output

consoleiterm

I am looking for a solution that would allow me to use color highlighting to a set of important output messages inside iTerm terminal application.

Things to highlight:

  • application logs file warnings, errors and fatals (apache, nginx, tomcat)
  • compiler output
  • other similar errors/warnings

enter image description here

Best Answer

iTerm supports coloring of console output based on a set of regular expressions. You can set them up in Preferences > Profiles > Advanced > Triggers > Edit.

Here is my current set of regexes:

(?i:.*error.*)                     // Yellow on Black
(?i:.*(warning|warn).*)            // Orange on Black
(?i:.*FATAL.*)                     // White on Red

iTerm regexes in a profile’s Triggers

You are welcome to improve it :)