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.191.6 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.191.5 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.191.4 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.191.3 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.191.2 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.191.1 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.191.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.190.3 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.190.2 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.190.1 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.190.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.189.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.188.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.187.1 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.187.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.186.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.185.2 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.185.1 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.185.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.184.0 lib/aws-sdk-core/log/handler.rb