Added silencing to the default Logger class

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1271 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 1edb807a
*SVN*
* Added silencing to the default Logger class
*1.0.4* (19th April, 2005)
* Fixed that in some circumstances controllers outside of modules may have hidden ones inside modules. For example, admin/content might have been hidden by /content. #1075 [Nicholas Seckar]
......
require 'logger'
class Logger #:nodoc:
# Silences the logger for the duration of the block.
def silence
result = nil
old_logger_level = level
self.level = Logger::ERROR
result = yield
self.level = old_logger_level
return result
end
private
remove_const "Format"
Format = "%s\n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册