提交 081dfca3 编写于 作者: J José Valim

Clean up Rails::Rack::Logger.

上级 edb81315
......@@ -9,27 +9,23 @@ def initialize(app)
end
def call(env)
@env = env
before_dispatch
result = @app.call(@env)
after_dispatch
result
before_dispatch(env)
@app.call(env)
ensure
after_dispatch(env)
end
protected
def request
@request ||= ActionDispatch::Request.new(@env)
end
def before_dispatch
def before_dispatch(env)
request = ActionDispatch::Request.new(env)
path = request.request_uri.inspect rescue "unknown"
info "\n\nStarted #{request.method.to_s.upcase} #{path} " <<
"for #{request.remote_ip} at #{Time.now.to_s(:db)}"
end
def after_dispatch
def after_dispatch(env)
Rails::Subscriber.flush_all!
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册