diff --git a/lib/supplejack/log_subscriber.rb b/lib/supplejack/log_subscriber.rb index 8a14f06..db2f2f2 100644 --- a/lib/supplejack/log_subscriber.rb +++ b/lib/supplejack/log_subscriber.rb @@ -12,9 +12,9 @@ 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] @@ -22,7 +22,7 @@ def log_request(duration, payload, solr_request_params = {}) 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 @@ -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 diff --git a/lib/supplejack/version.rb b/lib/supplejack/version.rb index 006ac12..102fffc 100644 --- a/lib/supplejack/version.rb +++ b/lib/supplejack/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Supplejack - VERSION = '2.3.11' + VERSION = '2.3.13' end