1 unstable release

0.1.0 Feb 13, 2022

#912 in Debugging

MIT license

5KB
117 lines

Sloggrs

Simple logging helper written in rust

Log levels

  • DEBUG: Debug information, (not needed in production)
  • INFO: Informations about progress (OK for production)
  • WARN: Warnings, nothing really dangerous but may be useful to find potential errors
  • ERROR: Recoverable errors
  • FATAL: Unrecoverable errors

Example

#[macro_use]
extern crate sloggrs;

fn main() {
    // Log only warnings and superior (enables WARN > ERROR > FATAL logs levels)
    init!(WARN);

    // Will **not** be logged
    debug!("Some really interesting debug message");

    // Will **not** be logged
    info!("Random information");

    // Will be logged
    warn!("Some information");

    // Will be logged
    error!("Failed to fail!")

    // Will be logged
    fatal!("Picards!");
}

lib.rs:

Sloggrs - Simple logger

No runtime deps