errlog

Crates.ioerrlog
lib.rserrlog
version0.0.2
sourcesrc
created_at2021-09-19 03:58:40.290433
updated_at2021-09-19 04:10:07.112803
descriptionA simple error logger based on anyhow
homepage
repositoryhttps://github.com/ikey4u/errlog
max_upload_size
id453482
size2,046
zhq (ikey4u)

documentation

README

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))?; 
Commit count: 5

cargo fmt