aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorGuo Xiang Tan <tgx_world@hotmail.com>2014-07-18 14:27:08 +0800
committerGuo Xiang Tan <tgx_world@hotmail.com>2014-07-18 15:04:43 +0800
commitee35b79d4cff24b960be54c3f5c4f46627c069fe (patch)
tree51bf939c44a735fe9aad005f1f9c880a396bbc73 /railties
parentd4c8068675f0b6be025590471b40ff175daa845e (diff)
downloadrails-ee35b79d4cff24b960be54c3f5c4f46627c069fe.tar.gz
rails-ee35b79d4cff24b960be54c3f5c4f46627c069fe.tar.bz2
rails-ee35b79d4cff24b960be54c3f5c4f46627c069fe.zip
Prefer to pass block when logging.
The Logger by default includes a guard which checks for the logging level. By removing the custom logging guards, we can decouple the logging guard from the logging action to be done. This also follows the good practice listed on http://guides.rubyonrails.org/debugging_rails_applications.html#impact-of-logs-on-performance.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/rack/logger.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/rack/logger.rb b/railties/lib/rails/rack/logger.rb
index 3b35798679..9962e6d943 100644
--- a/railties/lib/rails/rack/logger.rb
+++ b/railties/lib/rails/rack/logger.rb
@@ -34,7 +34,7 @@ module Rails
instrumenter = ActiveSupport::Notifications.instrumenter
instrumenter.start 'request.action_dispatch', request: request
- logger.info started_request_message(request)
+ logger.info { started_request_message(request) }
resp = @app.call(env)
resp[2] = ::Rack::BodyProxy.new(resp[2]) { finish(request) }
resp