Colourful-Logger 2.0
The Colourful-Logger is a simple yet effective logging utility designed to enhance the readability of log messages by incorporating vibrant colors. Allowing you to also print structs, strings and other important types, either to the terminal or to a file.
Features
- Easy to use
- Colour coded log levels
- Quick identification of log types
- Enhanced readability
- Simple integration into projects
- Immediate visual improvement
- Terminal or File Logging
- Log any seralised data structures
- Log filtering
How to use
You can use either lazy_static! to use the logger as a global variable Colourful logger also has a built in default(), if you want a preset Logging.
[!IMPORTANT] If you want to log structs, which are typically not supported automatically Add
serde = { version = "1.0.213", features = ["derive"] }to yourCargo.tomlAnd then append#[derive(Serialize)]above your struct to seralise it. It is then accessible to the logger as an object.
You may change the log file, remove the log file or even change the LogLevel at any time.
Change File and LogLevel
use ;
Without Default, but Lazy Static!
use ;
use lazy_static;
use Serialize;
lazy_static!
:
With Default, without Lazy Static!
use Logger as Logger;
:
Bug Reports | Features
If there are any bugs, or features you'd like to implement into the logger, feel free to create a pr request and it'll be looked into.
License
This project uses the following license: MIT LICENSE.