| Crates.io | result_logger |
| lib.rs | result_logger |
| version | 0.1.1 |
| created_at | 2025-02-23 10:29:56.685207+00 |
| updated_at | 2025-02-23 10:34:18.030144+00 |
| description | aux functions for Results to log errors |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1566225 |
| size | 5,893 |
Rust crate to ease the logging of error results.
Just call the provided log funtions on Results and if its an error it gets logged by your logging implementation.
fn calling_func() -> Result<(), String> {
failing_func().error()?;
// Do something
Ok(())
}
fn failing_func() -> Result<(), String> {
Err("This is an error".to_string())
}
-> This will log the error message "This is an error" with the log level Error.
This project is licensed under the MIT License. Feel free to contribute and modify as per the guidelines outlined in the license agreement.