From 704a8e7b019093f82a8faa3c7846865191e40214 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Wed, 27 Jan 2021 18:04:16 +1100 Subject: [PATCH] Add swap id to tracing context --- swap/src/protocol/alice/swap.rs | 1 + swap/src/protocol/bob/swap.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/swap/src/protocol/alice/swap.rs b/swap/src/protocol/alice/swap.rs index 2abe8e67..198ee389 100644 --- a/swap/src/protocol/alice/swap.rs +++ b/swap/src/protocol/alice/swap.rs @@ -55,6 +55,7 @@ pub async fn run(swap: alice::Swap) -> Result { run_until(swap, is_complete).await } +#[tracing::instrument(name = "swap", skip(swap,is_target_state), fields(id = %swap.swap_id))] pub async fn run_until( swap: alice::Swap, is_target_state: fn(&AliceState) -> bool, diff --git a/swap/src/protocol/bob/swap.rs b/swap/src/protocol/bob/swap.rs index 767372be..808f551a 100644 --- a/swap/src/protocol/bob/swap.rs +++ b/swap/src/protocol/bob/swap.rs @@ -32,6 +32,7 @@ pub async fn run(swap: bob::Swap) -> Result { run_until(swap, is_complete).await } +#[tracing::instrument(name = "swap", skip(swap,is_target_state), fields(id = %swap.swap_id))] pub async fn run_until( swap: bob::Swap, is_target_state: fn(&BobState) -> bool,