class Sinew::Middleware::LogFormatter

Minimalist Formatter that logs proxy if present.

Public Instance Methods

request(env) click to toggle source
# File lib/sinew/middleware/log_formatter.rb, line 5
def request(env)
  info('req') do
    # Only log the initial request, not the redirects
    return if env[:redirect]

    msg = apply_filters(env.url.to_s)
    msg = "#{msg} (#{env.method})" if env.method != :get
    msg = "#{msg} => #{env.request.proxy.uri}" if env.request.proxy

    msg
  end
end
response(env) click to toggle source
# File lib/sinew/middleware/log_formatter.rb, line 18
def response(env)
  # silent
end