Sha256: 5c79137c39e23da82291d5535c260d972e9ba7aa075ef382a66869b0af7af6b0

Contents?: true

Size: 974 Bytes

Versions: 190

Compression:

Stored size: 974 Bytes

Contents

# frozen_string_literal: true

module Seahorse
  module Client
    # @deprecated Use Aws::Logging instead.
    # @api private
    module Logging
      class Handler < Client::Handler

        # @param [RequestContext] context
        # @return [Response]
        def call(context)
          context[:logging_started_at] = Time.now
          @handler.call(context).tap do |response|
            context[:logging_completed_at] = Time.now
            log(context.config, response)
          end
        end

        private

        # @param [Configuration] config
        # @param [Response] response
        # @return [void]
        def log(config, response)
          config.logger.send(config.log_level, format(config, response))
        end

        # @param [Configuration] config
        # @param [Response] response
        # @return [String]
        def format(config, response)
          config.log_formatter.format(response)
        end

      end
    end
  end
end

Version data entries

190 entries across 190 versions & 1 rubygems

Version Path
aws-sdk-core-3.214.0 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.213.0 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.212.0 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.211.0 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.210.0 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.209.1 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.209.0 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.208.0 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.207.0 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.206.0 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.205.0 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.204.0 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.203.0 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.202.2 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.202.1 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.202.0 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.201.5 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.201.4 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.201.3 lib/seahorse/client/logging/handler.rb
aws-sdk-core-3.201.2 lib/seahorse/client/logging/handler.rb