Sha256: bf65638c66b768c7abe2f797fd0c5642a032cf18dafec9fc204315d9eb1f724f

Contents?: true

Size: 911 Bytes

Versions: 197

Compression:

Stored size: 911 Bytes

Contents

# frozen_string_literal: true

module Seahorse
  module Client
    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

197 entries across 197 versions & 1 rubygems

Version Path
aws-sdk-core-3.110.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.109.3 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.109.2 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.109.1 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.109.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.108.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.107.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.105.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.104.4 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.104.3 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.104.2 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.104.1 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.104.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.103.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.102.1 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.102.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.101.0 lib/aws-sdk-core/log/handler.rb