err_trail
Convience methods on Result and Option for logging when an Err or None is ecountered. Similar to eros and anyhow
but for logging.
Feature Flags
tracing / log / defmt :
Enables support for the tracing or log or defmt crates. error, warn, info, debug, and trace methods are added to Result and are executed when the Result is an Err for logging purposes. They work similarly to eros's and anyhow's .context(..) method. e.g.
use ;
This is useful tracing context around errors. e.g.
use ;
rather than
Notes For Libraries
This api is perfect for libraries. Downstream binaries ultimately decide the implementation for which logging provider to use, if any. If no implementations is selected, since all the above methods are inlined, the code becomes a no-op and will be optimized away during compilation.
Guide

Additional Notes
- If returning a
Result, context should usually bewarn. - If consuming a
Result, context should usually beerror. errorcan also be used overwarnfor cases that should not be possible, but handling is preferred over panic in production.
no_std
This crate supports #![no_std].