Crates.io | exlog |
lib.rs | exlog |
version | 0.1.4 |
source | src |
created_at | 2021-10-05 11:37:01.348398 |
updated_at | 2021-10-06 06:36:32.945033 |
description | a very simple logger for small projects |
homepage | |
repository | |
max_upload_size | |
id | 460560 |
size | 6,272 |
Install exlog
by adding this line to your Cargo.toml
:
exlog = "0.1.4"
let logger = Logger::new("my_app");
logger.info("no errors have been predicted");
logger.warn("an error has been predicted");
logger.error("an error occurred!");
logger.save_to_file("log.txt");
// prints:
// [my_app:INFO] no errors have been predicted
// [my_app:WARNING] an error has been predicted
// [my_app:ERROR] an error occurred!
// ...and writes all of it to log.txt