diff options
author | Genadi Samokovarov <gsamokovarov@gmail.com> | 2016-06-10 12:00:19 +0300 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-07-02 06:09:10 +0930 |
commit | 40fc3874f0ea720c0780b2eae72f48c0879f325e (patch) | |
tree | a949306448b859dd980c69b882d5691a026142f2 /actionpack/lib | |
parent | ea40ec56ba9bb44c91ffd8b621718faf960f340d (diff) | |
download | rails-40fc3874f0ea720c0780b2eae72f48c0879f325e.tar.gz rails-40fc3874f0ea720c0780b2eae72f48c0879f325e.tar.bz2 rails-40fc3874f0ea720c0780b2eae72f48c0879f325e.zip |
Silence DebugExceptions template render logs during exceptions
When an exception is raised, those Action View rendering logs are just
noise for the end developer. I recently silenced those from Web Console,
as we do use Action View rendering in it as well. It used created a half
a screen of rendering logs. I think we can save those in this recent
push for cleaner development logs.
Now, the silencing is a bit hacky and we have a bunch of it now, so we
can also invest in turning off the logs directly from Action View
objects instead of silencing off the logging stream.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/debug_exceptions.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb index 5f758d641a..8974258cf7 100644 --- a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb +++ b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb @@ -36,6 +36,14 @@ module ActionDispatch def debug_hash(object) object.to_hash.sort_by { |k, _| k.to_s }.map { |k, v| "#{k}: #{v.inspect rescue $!.message}" }.join("\n") end + + def render(*) + if logger = ActionView::Base.logger + logger.silence { super } + else + super + end + end end def initialize(app, routes_app = nil, response_format = :default) |