errlog 0.0.2

A simple error logger based on anyhow
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 0 items with examples
  • Size
  • Source code size: 1.95 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.10 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • ikey4u/errlog
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ikey4u

errlog

errlog is a simple log library based on anyhow, it wraps file name and line number for your error message.

Add the errlog dependencies into your Cargo.toml, then import errlog macro

use errlog::{elog, AnyContext, AnyResult};

Now you can use it in function that return AnyResult<xxx> such as

return Err(elog!("Unkown file type")); 

or

File:open(filepath).context(elog!("Cannot open file {}", filepath))?;