Crate logsy

Crate logsy 

Source
Expand description

logsy provides a simple facility for your daily logging tasks.

Calling set_echo or set_filename for a first time gets our logging handler automatically installed.

§Usage

use log::*;

logsy::set_echo(true);
logsy::set_filename(Some("logs/main.log")).expect("Couldn't open main.log");
 
info!("Application has just started");
warn!("Dereferencing null pointers harms");
error!("This application got a boo-boo and going to be terminated");

Functions§

set_echo
Start logging into stdout
set_filename
Start logging into a specified file. This function can be called again without restarting the app if you need (e.g. for implementing log rotation). If parent dir doesn’t exists, it’s going to be created.
set_level
Set log level filter