Crate plog

source ·
Expand description

A modular pretty logger for Rust

Created with the philosophy to be minimum but extensible everything (except core) is a feature, every configuration is defined in compiler-level to minimal run-time overhead.


Simplest as possible, works like a std::println! (more exatcly as a std::eprintln!):

use plog::{info, ok};
use std::{thread, time::Duration};

let threads: Vec<_> = (0..=10)
    .map(|id| {
        info!("Creating thread {id}");
        thread::spawn(move || {
            ok!("Thread {id} terminated");
threads.into_iter().for_each(|thr| thr.join().unwrap());


All the available features are listed here


Core of the library. Contains the front-end to plog::log, formating arguments and applying features defined at compile-time


A debugging logger, just will compile the log message when debug_assert is enabled
An error logger, the highest importancy level, for things that will affect the program use
An info logger, the lowest importancy level
Log formatter, apply every formating feature enabled:
Success logger, for things that is working. The “release version” of plog::debug! Also works on debug_assert
A warn logger, for things that don’t affect the program flow


Log handler Checks the enabled features and write to specified streams persistent enable write to a file colored enable colored output to terminal