Skip to content

Commit

Permalink
Merge pull request #75 from DigitalNZ/dl/revert-2-3-12-changes
Browse files Browse the repository at this point in the history
REVERT BREAKING CHANGES & ADD MINOR VERSION UPGRADE
  • Loading branch information
danielaboost authored Feb 15, 2024
2 parents 06aed77 + c7c4ff5 commit 0e05dbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/supplejack/log_subscriber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ def log_request(duration, payload, solr_request_params = {})

name = format('%s (%.1fms)', "Supplejack API #{Rails.env}", duration)

parameters = payload[:params].map { |k, v| "#{k}: #{colorize(v, MODES[:bold])}" }.join(', ')
body = payload[:payload].map { |k, v| "#{k}: #{colorize(v, MODES[:bold])}" }.join(', ')
options = payload[:options].map { |k, v| "#{k}: #{colorize(v, MODES[:bold])}" }.join(', ')
parameters = payload[:params].map { |k, v| "#{k}: #{colorize(v, BOLD)}" }.join(', ')
body = payload[:payload].map { |k, v| "#{k}: #{colorize(v, BOLD)}" }.join(', ')
options = payload[:options].map { |k, v| "#{k}: #{colorize(v, BOLD)}" }.join(', ')
request = "#{method.to_s.upcase} path=#{payload[:path]} params={#{parameters}}, body={#{body}} options={#{options}}"

if payload[:exception]
info = "\n #{colorize('Exception', RED)} [ #{payload[:exception].join(', ')} ]"
else
info = ''
if solr_request_params.try(:any?)
solr_request_params = solr_request_params.map { |k, v| "#{k}: #{colorize(v, MODES[:bold])}" }.join(', ')
solr_request_params = solr_request_params.map { |k, v| "#{k}: #{colorize(v, BOLD)}" }.join(', ')
info = "\n #{colorize('SOLR Request', YELLOW)} [ #{solr_request_params} ]"
end
end
Expand All @@ -35,7 +35,7 @@ def colorize(text, color)
when Array then "[#{text.map { |e| colorize(e, color) }.join(', ')}]"
when Hash then "{#{text.map { |k, v| "#{k}: #{colorize(v, color)}" }.join(', ')}}"
else
"#{MODES[:bold]}#{color}#{text}#{MODES[:clear]}"
"#{BOLD}#{color}#{text}#{CLEAR}"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/supplejack/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Supplejack
VERSION = '2.3.11'
VERSION = '2.3.13'
end

0 comments on commit 0e05dbd

Please sign in to comment.