Skip to content

Commit

Permalink
feat: log pact content as debug instead of info when publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed May 20, 2018
1 parent bf8130f commit d116157
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/pact_broker/pacts/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions lib/pact_broker/pacts/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d116157

Please sign in to comment.