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.128.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.127.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.126.2 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.126.1 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.126.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.125.6 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.125.5 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.125.4 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.125.3 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.125.2 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.125.1 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.125.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.124.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.123.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.122.1 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.122.0 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.121.6 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.121.5 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.121.3 lib/aws-sdk-core/log/handler.rb
aws-sdk-core-3.121.2 lib/aws-sdk-core/log/handler.rb