This commit adds a possibility to color the log levels using an ansi_term
crate for this purpose.
The change was intended for WriteLogger in mind, but as this feature will
be configurable and put in generic logging code, then other loggers can
benefit as well (if desired).
This way one can easily create a logfile with a similar colored look
as it is printed real-time on a terminal/console.
Tip: To view such a logfile with colors using 'less' you can use:
less -R /path/to/logfile
Coverage decreased (-2.6%) to 67.4% when pulling cda775724849ff11ac2549723496b1afa7b8a737 on manio:level-colorize into f41c17969660c2dadc7f2644700c94ea7a649458 on Drakulix:master.
This commit adds a possibility to color the log levels using an ansi_term crate for this purpose.
The change was intended for WriteLogger in mind, but as this feature will be configurable and put in generic logging code, then other loggers can benefit as well (if desired).
This way one can easily create a logfile with a similar colored look as it is printed real-time on a terminal/console.
Tip: To view such a logfile with colors using 'less' you can use: less -R /path/to/logfile