Sha256: 93b6aeab2012a1943430f0daf9d1287f1677860530a4d5bd97b41381754ce94f
Contents?: true
Size: 412 Bytes
Versions: 31
Compression:
Stored size: 412 Bytes
Contents
require "logger" class ApiClient::Connection::Middlewares::Request::Logger < Faraday::Middleware def call(env) time = Time.now returns = @app.call(env) taken = Time.now - time @logger.info "#{env[:method].to_s.upcase} #{env[:url]}: #{"%.4f" % taken} seconds" returns end def initialize(app, logger = nil) @logger = logger || ::Logger.new(STDOUT) @app = app end end
Version data entries
31 entries across 31 versions & 1 rubygems