Sha256: 985055c01cf1914d461c25eaa70e10e74750fec97130719c6f9b5cb77a51924d

Contents?: true

Size: 727 Bytes

Versions: 14

Compression:

Stored size: 727 Bytes

Contents

module VCR
  # @private
  module Logger
    def log(message, indentation_level = 0)
      indentation = '  ' * indentation_level
      log_message = indentation + log_prefix + message
      VCR.configuration.debug_logger.puts log_message
    end

    def log_prefix
      ''
    end

    def request_summary(request, request_matchers)
      attributes = [request.method, request.uri]
      attributes << request.body.to_s[0, 80].inspect if request_matchers.include?(:body)
      attributes << request.headers.inspect          if request_matchers.include?(:headers)
      "[#{attributes.join(" ")}]"
    end

    def response_summary(response)
      "[#{response.status.code} #{response.body[0, 80].inspect}]"
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
vcr-2.5.0 lib/vcr/util/logger.rb
vcr-2.4.0 lib/vcr/util/logger.rb
vcr-2.3.0 lib/vcr/util/logger.rb
vcr-2.2.5 lib/vcr/util/logger.rb
vcr-2.2.4 lib/vcr/util/logger.rb
vcr-2.2.3 lib/vcr/util/logger.rb
vcr-2.2.2 lib/vcr/util/logger.rb
vcr-2.2.1 lib/vcr/util/logger.rb
vcr-2.2.0 lib/vcr/util/logger.rb
vcr-2.1.1 lib/vcr/util/logger.rb
vcr-2.1.0 lib/vcr/util/logger.rb
vcr-2.0.1 lib/vcr/util/logger.rb
vcr-2.0.0 lib/vcr/util/logger.rb
vcr-2.0.0.rc2 lib/vcr/util/logger.rb