slog_unwraps
Syntactic sugar to slog an error before unwrapping. It will add caller file and line information to the log statement so you don't have to turn on RUST_BACKTRACE to see what went wrong, but know that that only makes sense in debug mode. In release mode this information will either be missing or unreliable.
At first I had an expects
function as well to be able to add context, but I really think you should use the
failure
crate, which provides a context
method on errors, and it's much cleaner, so expects
no longer exists. If you don't want to use failure
, you will have to make sure your errors display sensible messages.
Example
run with cargo run --example basic
use
;
License: Unlicense