Permalink
Browse files

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
  • Loading branch information...
1 parent c29db9f commit 908e9a17d8166d9b83609ec3aa877717a21d8ab7 @dhh dhh committed Apr 13, 2005
Showing with 4 additions and 1 deletion.
  1. +2 −0 activerecord/CHANGELOG
  2. +2 −1 activerecord/lib/active_record/base.rb
@@ -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
@@ -662,9 +662,10 @@ def benchmark(title)
# 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

0 comments on commit 908e9a1

Please sign in to comment.