Skip to content

Woomymy/sloggrs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!");
}

About

Simple logger written in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages