Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →HASH tracing and instrumentation practices for Rust.
77% 95%+18 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 17 of 22 without it.
3 of 3 safety checks passed
Not used yet
info!, debug!, trace!, warn!, error!Display, using %error or error = %errorerror_stack::Report<Context> with Debug, using ?report or error = ?report on the complete report rather than its current_context() aloneThese fragments assume a local user. Their error events are alternatives: e is an ordinary error value, and report is an error_stack::Report<_>.
tracing::info!(user_id = user.id, action = "login", "user logged in successfully");
tracing::error!(error = %e, user_id = user.id, "failed to authenticate user");
tracing::error!(error = ?report, user_id = user.id, "failed to authenticate user");
A report's plain Display stops after the first context and omits attachments. Its Debug formatter traverses the frames and renders printable attachments or installed hook output.
#[tracing::instrument] attribute to functions to automatically create trace spanserr for an ordinary error and err(Debug) for an error_stack::Report<Context>skip(password) or skip_allfields(request_id = req.id())#[tracing::instrument(level = "debug", err, skip(password), fields(user_id = user.id))]
async fn authenticate_user(user: &User, password: &[u8]) -> Result<AuthToken, AuthError> {
// Implementation
}
Next to this one in the catalogue, plus more from the same author.