Drakulix / simplelog.rs

Simple Logging Facility for Rust
https://docs.rs/simplelog/
Apache License 2.0
423 stars 71 forks source link

introduce colored log levels using ansi_term #88

Closed manio closed 2 years ago

manio commented 2 years ago

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

manio commented 2 years ago

It's almost done - I'll only add a configuration switch...

coveralls commented 2 years ago

Coverage Status

Coverage decreased (-2.6%) to 67.4% when pulling cda775724849ff11ac2549723496b1afa7b8a737 on manio:level-colorize into f41c17969660c2dadc7f2644700c94ea7a649458 on Drakulix:master.

manio commented 2 years ago

@Drakulix Done as you suggested, please review