diff --git a/rust/pact_ffi/src/log/ffi.rs b/rust/pact_ffi/src/log/ffi.rs index 3bd3bbfe..5f1bb40a 100644 --- a/rust/pact_ffi/src/log/ffi.rs +++ b/rust/pact_ffi/src/log/ffi.rs @@ -8,9 +8,8 @@ use std::str::from_utf8; use libc::{c_char, c_int}; use log::{error, LevelFilter as LogLevelFilter}; -use pact_matching::logging::fetch_buffer_contents; - use crate::error::set_error_msg; +use crate::log::inmem_buffer::fetch_buffer_contents; use crate::log::level_filter::LevelFilter; use crate::log::logger::{add_sink, apply_logger, init_logger}; use crate::log::sink::Sink; diff --git a/rust/pact_ffi/src/log/inmem_buffer.rs b/rust/pact_ffi/src/log/inmem_buffer.rs index 07e12bd6..4df8ab0c 100644 --- a/rust/pact_ffi/src/log/inmem_buffer.rs +++ b/rust/pact_ffi/src/log/inmem_buffer.rs @@ -17,7 +17,7 @@ pub(crate) struct InMemBuffer { } impl Write for InMemBuffer { fn write(&mut self, buf: &[u8]) -> io::Result { - pact_matching::logging::write_to_log_buffer(buf); + write_to_log_buffer(buf); Ok(buf.len()) } diff --git a/rust/pact_ffi/src/log/mod.rs b/rust/pact_ffi/src/log/mod.rs index b61b1998..b5df13c5 100644 --- a/rust/pact_ffi/src/log/mod.rs +++ b/rust/pact_ffi/src/log/mod.rs @@ -17,3 +17,7 @@ pub use crate::log::ffi::{ pactffi_log_to_file, pactffi_log_to_buffer }; +pub use crate::log::inmem_buffer::{ + fetch_buffer_contents, + write_to_log_buffer +}; diff --git a/rust/pact_ffi/src/mock_server/mod.rs b/rust/pact_ffi/src/mock_server/mod.rs index 5377bb1b..2fd59b57 100644 --- a/rust/pact_ffi/src/mock_server/mod.rs +++ b/rust/pact_ffi/src/mock_server/mod.rs @@ -63,7 +63,6 @@ use tokio_rustls::rustls::ServerConfig; use tracing::{error, warn}; use uuid::Uuid; -use pact_matching::logging::fetch_buffer_contents; use pact_matching::metrics::{MetricEvent, send_metrics}; use pact_mock_server::{MANAGER, mock_server_mismatches, MockServerError, tls::TlsConfigBuilder, WritePactFileErr}; use pact_mock_server::mock_server::MockServerConfig; @@ -72,6 +71,7 @@ use pact_models::generators::GeneratorCategory; use pact_models::matchingrules::{Category, MatchingRuleCategory}; use crate::{convert_cstr, ffi_fn, safe_str}; +use crate::log::fetch_buffer_contents; use crate::mock_server::handles::{PactHandle, path_from_dir}; use crate::string::optional_str; diff --git a/rust/pact_ffi/src/verifier/mod.rs b/rust/pact_ffi/src/verifier/mod.rs index dd2834e8..38ed1fa8 100644 --- a/rust/pact_ffi/src/verifier/mod.rs +++ b/rust/pact_ffi/src/verifier/mod.rs @@ -16,10 +16,10 @@ use pact_models::prelude::HttpAuth; use regex::Regex; use serde::{Deserialize, Serialize}; -use pact_matching::logging::fetch_buffer_contents; use pact_verifier::selectors::{consumer_tags_to_selectors, json_to_selectors}; use crate::{as_mut, as_ref, ffi_fn, RUNTIME, safe_str}; +use crate::log::fetch_buffer_contents; use crate::ptr; use crate::util::string::{if_null, optional_str};