Skip to content

Commit

Permalink
Fix tracing compilation error in example 7 (#1253)
Browse files Browse the repository at this point in the history
This fixes a compilation error regarding usage of the `#[instrument]` macro in example 7.
arqunis authored Mar 6, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent c166ece commit 3aa6aae
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions examples/e07_env_logging/src/main.rs
Original file line number Diff line number Diff line change
@@ -24,10 +24,9 @@ impl EventHandler for Handler {
// For instrument to work, all parameters must implement Debug.
//
// Handler doesn't implement Debug here, so we specify to skip that argument.
// Context doesn't implement Debug either, but since it's ignored already, it
// doesn't need to be skipped.
#[instrument(skip(self))]
async fn resume(&self, _: Context, resume: ResumedEvent) {
// Context doesn't implement Debug either, so it is also skipped.
#[instrument(skip(self, _ctx))]
async fn resume(&self, _ctx: Context, resume: ResumedEvent) {
// Log at the DEBUG level.
//
// In this example, this will not show up in the logs because DEBUG is

0 comments on commit 3aa6aae

Please sign in to comment.