Rimplog
A simple, colorful, and easy-to-use logging library for Rust
Rimplog means Rainbow Simple Logging
Getting Started with rimplog
rimplog is a simple, colorful, and easy-to-use logging library for Rust. This guide will help you get started with rimplog in your Rust projects.
Dependencies
To use rimplog in your project, add the following to your Cargo.toml file:
[]
= "0.0.3"
Building the Logger
rimplog uses a builder pattern to configure the logger. Here's how to create a custom logger:
use ;
let logger = LoggerBuilder ;
Customizing the Logger
You can customize the following options:
level: Log level (error,warn,info,debug,trace)only_project_logs: Whether to show only project logs (true/false)path_depth: Depth of file path to displaytime_format: Custom time format stringpreset: Logger preset (FULL,THREAD,SIMPLE)
Initializing the Logger
Once you've built your logger, initialize it at the start of your program:
use init_logger;
If you're happy with the default settings, you can simply use:
init_logger;
Using the Logger
After initialization, you can use the logging macros throughout your code:
use ;
For logs without automatic newlines, use the underscore versions:
use ;
That's it! You're now ready to use rimplog in your Rust projects. Enjoy colorful and customizable logging!