aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2014-08-09 10:42:45 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2014-08-09 10:42:45 -0300
commit9c6c5aa9297883cea779839299b08a2ee4548856 (patch)
tree51765220567b23b6d5d08dce6362440eb012dffb /actionpack/lib/action_controller/metal
parent7bb5a8f59015f87291a816de0e38b840cfd9f9f0 (diff)
parentbc53543cb3805abd334745a50c9014b31096c8da (diff)
downloadrails-9c6c5aa9297883cea779839299b08a2ee4548856.tar.gz
rails-9c6c5aa9297883cea779839299b08a2ee4548856.tar.bz2
rails-9c6c5aa9297883cea779839299b08a2ee4548856.zip
Merge pull request #16440 from tgxworld/pass_log_in_block
Pass block for logging.
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r--actionpack/lib/action_controller/metal/live.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/metal/live.rb b/actionpack/lib/action_controller/metal/live.rb
index 706ce04062..c9ef3a3dad 100644
--- a/actionpack/lib/action_controller/metal/live.rb
+++ b/actionpack/lib/action_controller/metal/live.rb
@@ -303,10 +303,12 @@ module ActionController
logger = ActionController::Base.logger
return unless logger
- message = "\n#{exception.class} (#{exception.message}):\n"
- message << exception.annoted_source_code.to_s if exception.respond_to?(:annoted_source_code)
- message << " " << exception.backtrace.join("\n ")
- logger.fatal("#{message}\n\n")
+ logger.fatal do
+ message = "\n#{exception.class} (#{exception.message}):\n"
+ message << exception.annoted_source_code.to_s if exception.respond_to?(:annoted_source_code)
+ message << " " << exception.backtrace.join("\n ")
+ "#{message}\n\n"
+ end
end
def response_body=(body)