diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-26 15:37:45 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-26 15:37:45 +0100 |
commit | 081dfca33a7254ae86baa8feeb31f2c293b5f165 (patch) | |
tree | 8e7685fce28c0bccd6cdd96c2061d693a2a3e457 | |
parent | edb8131535c74ac215bf36c0d58d2019ed091a74 (diff) | |
download | rails-081dfca33a7254ae86baa8feeb31f2c293b5f165.tar.gz rails-081dfca33a7254ae86baa8feeb31f2c293b5f165.tar.bz2 rails-081dfca33a7254ae86baa8feeb31f2c293b5f165.zip |
Clean up Rails::Rack::Logger.
-rw-r--r-- | railties/lib/rails/rack/logger.rb | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/railties/lib/rails/rack/logger.rb b/railties/lib/rails/rack/logger.rb index 91a613092f..de21fb4f10 100644 --- a/railties/lib/rails/rack/logger.rb +++ b/railties/lib/rails/rack/logger.rb @@ -9,27 +9,23 @@ module Rails 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 |