diff --git a/rust/pact_ffi/src/verifier/handle.rs b/rust/pact_ffi/src/verifier/handle.rs index a6679c1d..8b3dca3c 100644 --- a/rust/pact_ffi/src/verifier/handle.rs +++ b/rust/pact_ffi/src/verifier/handle.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use itertools::Itertools; use serde_json::Value; use tracing::{debug, error}; - +use pact_matching::logging::LOG_ID; use pact_models::prelude::HttpAuth; use pact_verifier::{ConsumerVersionSelector, FilterInfo, NullRequestFilterExecutor, PactSource, ProviderInfo, ProviderTransport, PublishOptions, VerificationOptions, verify_provider_async}; use pact_verifier::callback_executors::HttpRequestProviderStateExecutor; @@ -286,7 +286,7 @@ impl VerifierHandle { let (calling_app_name, calling_app_version) = self.calling_app.clone().unwrap_or_else(|| { ("pact_ffi".to_string(), env!("CARGO_PKG_VERSION").to_string()) }); - match RUNTIME.block_on(async { + match RUNTIME.block_on(LOG_ID.scope(format!("verify:{}", self.provider.name), async { verify_provider_async( self.provider.clone(), self.sources.clone(), @@ -301,7 +301,7 @@ impl VerifierHandle { app_version: calling_app_version.clone() }) ).await - }) { + })) { Ok(result) => { self.verifier_output = result.clone(); if result.result { 0 } else { 1 } diff --git a/rust/pact_ffi/src/verifier/verifier.rs b/rust/pact_ffi/src/verifier/verifier.rs index a20951cb..527cc264 100644 --- a/rust/pact_ffi/src/verifier/verifier.rs +++ b/rust/pact_ffi/src/verifier/verifier.rs @@ -13,7 +13,7 @@ use pact_models::PactSpecification; use tracing::{debug, error, warn}; use tracing_core::LevelFilter; use tracing_subscriber::FmtSubscriber; - +use pact_matching::logging::LOG_ID; use pact_verifier::*; use pact_verifier::callback_executors::HttpRequestProviderStateExecutor; use pact_verifier::metrics::VerificationMetrics; @@ -247,7 +247,7 @@ async fn handle_matches(matches: &clap::ArgMatches<'_>) -> Result<(), i32> { debug!("Pact source to verify = {}", s); }; - verify_provider_async( + LOG_ID.scope(format!("verify:{}", provider.name), verify_provider_async( provider, source, filter, @@ -260,7 +260,7 @@ async fn handle_matches(matches: &clap::ArgMatches<'_>) -> Result<(), i32> { app_name: "unknown".to_string(), app_version: "unknown".to_string() }) - ).await + )).await .map_err(|err| { error!("Verification failed with error: {}", err); 2