mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
0b54f18c47
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2286 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
16 lines
No EOL
357 B
Ruby
16 lines
No EOL
357 B
Ruby
require 'logger'
|
|
|
|
class Logger #:nodoc:
|
|
# Silences the logger for the duration of the block.
|
|
def silence(temporary_level = Logger::ERROR)
|
|
old_logger_level, self.level = level, temporary_level
|
|
yield
|
|
ensure
|
|
self.level = old_logger_level
|
|
end
|
|
|
|
private
|
|
def format_message(severity, timestamp, msg, progname)
|
|
"#{msg}\n"
|
|
end
|
|
end |