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:
commit
9c6c5aa929
1 changed files with 6 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue