Registry / logging / tracing-unwrap

tracing-unwrap

JSON →
library1.0.1rscratesunverified

Extension traits for logging failed unwraps to a tracing subscriber.

# Cargo.toml [dependencies] tracing-unwrap = "1.0.1"
INSTALL
IMPORT
SIG · TRACING-UNWRAP
T
tracing-unwrap
loggingrustv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ResultExt
use tracing_unwrap::ResultExt;

Use ResultExt to log unwrap failures instead of panicking.

use tracing_unwrap::ResultExt; fn main() { let result: Result<i32, &str> = Ok(42); let value = result.unwrap_or_log(); println!("{}", value); }
Debug
Known issues
gotchaRequires a tracing subscriber to be set up to see logged errors.
fix
Initialize a tracing subscriber (e.g., tracing_subscriber::fmt::init()) before using unwrap_or_log.
affects: >=1.0.0
Upgrade
Version history
1.0.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
46 hits · last 30 days
node
42
OpenAI (training)
1
Resources
tracing-unwrap — cargo add tracing-unwrap · libregistry