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