1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #16440 from tgxworld/pass_log_in_block

Pass block for logging.
This commit is contained in:
Santiago Pastorino 2014-08-09 10:42:45 -03:00
commit 9c6c5aa929

View file

@ -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)