result_logger 0.1.0

aux functions for Results to log errors
Documentation
  • Coverage
  • 100%
    7 out of 7 items documented1 out of 7 items with examples
  • Size
  • Source code size: 14.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 166.54 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Lukas-Heiligenbrunner

result_logger

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.

Available functions

Usage

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.

License

This project is licensed under the MIT License. Feel free to contribute and modify as per the guidelines outlined in the license agreement.