From d1161573d8fb1836fb02f19315b11cab23cf4935 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Mon, 21 May 2018 07:58:09 +1000 Subject: [PATCH] feat: log pact content as debug instead of info when publishing --- lib/pact_broker/pacts/repository.rb | 2 +- lib/pact_broker/pacts/service.rb | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/pact_broker/pacts/repository.rb b/lib/pact_broker/pacts/repository.rb index 3edea2195..b2192b278 100644 --- a/lib/pact_broker/pacts/repository.rb +++ b/lib/pact_broker/pacts/repository.rb @@ -203,7 +203,7 @@ def find_or_create_pact_version consumer_id, provider_id, json_content end def create_pact_version consumer_id, provider_id, sha, json_content - PactBroker.logger.debug("Creating new PactVersion for sha #{sha}") + logger.debug("Creating new pact version for sha #{sha}") pact_version = PactVersion.new(consumer_id: consumer_id, provider_id: provider_id, sha: sha, content: json_content) pact_version.save end diff --git a/lib/pact_broker/pacts/service.rb b/lib/pact_broker/pacts/service.rb index 320fcad65..d119f0159 100644 --- a/lib/pact_broker/pacts/service.rb +++ b/lib/pact_broker/pacts/service.rb @@ -102,7 +102,8 @@ def pact_has_changed_since_previous_version? pact private def update_pact params, existing_pact - logger.info "Updating existing pact version with params #{params}" + logger.info "Updating existing pact publication with params #{params.reject{ |k, v| k == :json_content}}" + logger.debug "Content #{params[:json_content]}" updated_pact = pact_repository.update existing_pact.id, params if existing_pact.json_content != updated_pact.json_content @@ -113,7 +114,8 @@ def update_pact params, existing_pact end def create_pact params, version, provider - logger.info "Creating new pact version with params #{params}" + logger.info "Creating new pact publication with params #{params.reject{ |k, v| k == :json_content}}" + logger.debug "Content #{params[:json_content]}" pact = pact_repository.create json_content: params[:json_content], version_id: version.id, provider_id: provider.id, consumer_id: version.pacticipant_id trigger_webhooks pact pact