#logging #log-level #tiny #debugging #macro #hello-world

ferretlog

Tiny and simple logging macro for Rust

2 releases

0.1.1 Oct 29, 2023
0.1.0 Oct 29, 2023

#19 in #hello-world

MIT license

5KB
89 lines

Ferretlog

Tiny and simple logging macro for Rust. Based on the piglog crate but extended with default log levels and limited crate requirements.

Examples:

use ferretlog::*;

fn main() {
    ferretlog::critical!("Hello, world!");
    ferretlog::error!("Hello, world!");
    ferretlog::warning!("Hello, world!");
    ferretlog::notice!("Hello, world!");
    ferretlog::info!("Hello, world!");
    ferretlog::debug!("Hello, world!");
    ferretlog::todo!("Hello, world!");
}

Log Levels

This crate support the following log levels. These can be set using the LOG_LEVEL environment variable.

Log Level Description
Critical Signifies critical conditions in the program that demand intervention to prevent system failure.
Error Indicates error conditions that impair some operation but are less severe than critical situations.
Warning Signifies potential issues that may lead to errors or unexpected behavior in the future if not addressed.
Notice Applies to normal but significant conditions that may require monitoring.
Info Includes messages that provide a record of the normal operation of the application.
Debug Intended for logging detailed information about the application for debugging purposes.
Todo Indended as an additional tool to log todo items.

No runtime deps