Skip to content

Commit

Permalink
chore: Replicate setting the LOG_ID in the FFI verify functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rholshausen committed Sep 4, 2024
1 parent edc6a23 commit 1686185
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions rust/pact_ffi/src/verifier/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(),
Expand All @@ -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 }
Expand Down
6 changes: 3 additions & 3 deletions rust/pact_ffi/src/verifier/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 1686185

Please sign in to comment.