提交 40fc3874 编写于 作者: G Genadi Samokovarov 提交者: Matthew Draper

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.
上级 ea40ec56
......@@ -36,6 +36,14 @@ def debug_headers(headers)
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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册