Expand description
logsy provides a simple facility for your daily logging tasks.
set_echolog into stdoutset_filenamelog into a file (can be combined withset_echo)set_levelset log level filter (defaults toLevelFilter::Info)
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