Expand description
ยงLogi library
This library is used to log messages in a structured and beautiful way.
ยงAbout
This lib uses the println macro to log messages, exposes some macros to log messages in different levels.
The levels are:
- trace: for debug messages.
- debug: for info messages.
- success: for success messages.
- warn: for warning messages.
- error: for error messages.
- custom: for custom messages.
ยงExamples
#[macro_use] // We only need to import some macros to use `Logi`.
extern crate logi;
// Let's start logging!
fn main() {
// Info level.
trace!("Starting the CLI."); // 02:12:22 | ๐ง TRCE | Starting the CLI.
debug!("Starting the CLI."); // 02:12:22 | ๐ฎ DBUG | Starting the CLI.
// Confirmation level.
success!("Starting the CLI."); // 02:12:22 | ๐ YEEE | Starting the CLI.
// Warning & Error levels.
warn!("Starting the CLI."); // 02:12:22 | ๐ก WARN | Starting the CLI.
error!("Starting the CLI."); // 02:12:22 | ๐ฅ F#CK | Starting the CLI.
// Custom level. (Thats a different macro, here we define the level of the message as the way we want.)
custom!("๐งญ CSTM".to_string(), format!("Starting the {}.", "CLI")); // 20:39:24 | ๐งญ CSTM | Starting the CLI.
}Macrosยง
- custom
- ๐ง - Logs a message at the custom level.
- debug
- ๐ฎ - Logs a message at the debug level.
- error
- ๐ฅ - Logs a message at the error level.
- fatal
- ๐ต - Logs a message at the Fatal level.
- help
- ๐ญ - Logs a message at the help level.
- info
- ๐ฐ - Logs a message at the info level.
- success
- ๐ - Logs a message at the success level.
- trace
- ๐ง - Logs a message at the trace level.
- warn
- ๐ก - Logs a message at the warn level.
Enumsยง
Functionsยง
- log
- The standard logging function.