Log Colorizer

Log Colorizer

Requires: com.ioninja.log-colorizer
Status: ENABLED (all requirements are satisifed)

In older versions of IO Ninja (v5.0.4 and below), there was a plugin called "Regex Colorizer." It was implemented as a log converter layer, meaning that you would need to "attach" this layer plugin before you could colorize the log. In addition, the Regex Colorizer was scanning the existing log, adding extra records to colorize all discovered regular expression matches, and then writing an output log that was eventually presented to the user. The problem here is that to change what you want to colorize, you had to rebuild the whole log.

In IO Ninja version 5.1.0, we decided to fix these issues. The new colorizer engine is a built-in feature of the Ninja Scroll logging engine, so there's no need to attach a layer first — you can colorize your log at any time. Also, the new engine is capable of re-colorizing the log on the fly. Simply open the colorize dialog, update regular expressions and corresponding colors, and hit OK — the new colorization rules will be applied instantly.

Regex Engine Specifics

The IO Ninja regular expression engine is DFA-based (unlike backtracking engines used in PCRE, Python, Ruby, and many others). On the one hand, it means that no matter what the regular expression is and how many colorizing rules you add, the log will always get colorized FAST! That contrasts with traditional backtrackers, where an exponential performance drop is possible with certain regular expression patterns. Moreover, the number of alternatives directly impacts the performance of a backtracker. The DFA-based engine used in IO Ninja doesn't have the aforementioned drawbacks. On the other hand, IO Ninja doesn't support some advanced regular expression features available in PCRE and other backtrackers — most notably, backreferences and named groups.

Please refer to the tables below for the list of supported regular expression features.

ConstructDescription
^Begin-of-text or begin-of-line
$End-of-text or end-of-line
[ ]Character class
[^ ]Negated character class
( )Capturing group
(?: )Non-capturing group
?Preceding element is optional
??Preceding element is optional (non-greedy)
*Preceding element is repeated zero or more times
*?Preceding element is repeated zero or more times (non-greedy)
+Preceding element is repeated one or more times
+?Preceding element is repeated one or more times (non-greedy)
|Alternative
{ n }Preceding element is repeated n times
.Any character
Escape-sequenceDescription
\ABegin-of-text
\zEnd-of-text
\bWord boundary
\dDecimal digit
\DNot a decimal digit
\hHexadecimal digit
\HNot a hexadecimal digit
\wA word character
\WNot a word character
\sA space character
\SNot a space character
\0A zero character (U+0000)
\aAn alarm character (U+0007)
\eAn escape character (U+001B)
\fA formfeed character (U+000C)
\nA newline character (U+000A)
\rA carriage return character (U+000D)
\tA tabulation character (U+0009)
\vA vertical tabulation character (U+000B)
\x<HH>A character specified by two hexadecimal digits HH
\u<HHHH>A character specified by four hexadecimal digits HHHH
\U<HHHHHHHH>A character specified by eight hexadecimal digits HHHHHHHH
\<DDD>A character specified by three octal digits DDD