diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2014-08-09 10:42:45 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2014-08-09 10:42:45 -0300 |
commit | 9c6c5aa9297883cea779839299b08a2ee4548856 (patch) | |
tree | 51765220567b23b6d5d08dce6362440eb012dffb /actionpack/lib/action_controller/metal/live.rb | |
parent | 7bb5a8f59015f87291a816de0e38b840cfd9f9f0 (diff) | |
parent | bc53543cb3805abd334745a50c9014b31096c8da (diff) | |
download | rails-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/live.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/live.rb | 10 |
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) |