class Fluentdly::Rack::Middleware::Debug

Attributes

body[R]
env[R]
headers[R]
status[R]
time[R]

Public Class Methods

call(*args) click to toggle source
# File lib/fluentdly/rack/middleware/debug.rb, line 8
def self.call *args
  formatter = new(*args)
  formatter.call
end
new(env, time, result) click to toggle source
# File lib/fluentdly/rack/middleware/debug.rb, line 13
def initialize env, time, result
  @env  = env
  @time = time

  @status, @headers, @body = result
end

Public Instance Methods

call() click to toggle source
# File lib/fluentdly/rack/middleware/debug.rb, line 20
def call
  %Q(
  Received #{data.request_method} #{data.path_info}
    params: #{data.params.inspect}
  Responded in #{time}ms
    status: #{status}
    headers: #{headers}
    body: #{body.inspect}
  )
end

Private Instance Methods

data() click to toggle source
# File lib/fluentdly/rack/middleware/debug.rb, line 33
def data
  @data ||= ::Rack::Request.new(env)
end