1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fixed that Base.silence should restore the old logger level when done, not just set it to DEBUG #1084 [yon@milliped.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1155 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-04-13 05:16:52 +00:00
parent c29db9f210
commit 908e9a17d8
2 changed files with 4 additions and 1 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Fixed that Base.silence should restore the old logger level when done, not just set it to DEBUG #1084 [yon@milliped.com]
* Fixed boolean saving on Oracle #1093 [mparrish@pearware.org]
* Moved build_association and create_association for has_one and belongs_to out of deprecation as they work when the association is nil unlike association.build and association.create, which require the association to be already in place #864

View file

@ -662,9 +662,10 @@ module ActiveRecord #:nodoc:
# Silences the logger for the duration of the block.
def silence
result = nil
old_logger_level = logger.level if logger
logger.level = Logger::ERROR if logger
result = yield
logger.level = Logger::DEBUG if logger
logger.level = old_logger_level if logger
return result
end