| Crates.io | logsy |
| lib.rs | logsy |
| version | 1.0.1 |
| created_at | 2025-05-31 08:11:22.249385+00 |
| updated_at | 2025-05-31 16:47:02.914885+00 |
| description | Just logging as it should be |
| homepage | |
| repository | https://github.com/vdudouyt/logsy |
| max_upload_size | |
| id | 1696168 |
| size | 22,542 |
Just logging as it should be. While it barely exceeds 100 lines of source code, it covers almost any practical case you could ever encounter.
logsy::set_echo() to start logging into stdoutlogsy::set_filename() to start logging into a specified file. If parent dir doesn't exists, it's going to be createdlogsy::set_level() to alter logging level (defaults to LevelFilter::Info)logsy::set_echo() and logsy::set_filename() in the same applicationlogsy::set_echo() or logsy::set_filename() again at any timeuse log::*;
fn main() {
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");
}