Changeset 2715
- Timestamp:
- 10/23/05 20:00:05 (3 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/clean_logger.rb (modified) (1 diff)
- trunk/activesupport/test/clean_logger_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r2696 r2715 4 4 5 5 * Abbreviate RAILS_ROOT in traces 6 7 6 8 7 *1.10.1* (October 19th, 2005) trunk/activerecord/CHANGELOG
r2714 r2715 1 *SVN* 2 3 * Keep closer tabs on dirty, loaded, and declared fixtures. #2404 [ryand-ruby@zenspider.com] 4 5 * Map Active Record time to SQL TIME. #2575, #2576 [Robby Russell <robby@planetargon.com>] 6 7 * Clarify semantics of ActiveRecord::Base#respond_to? #2560 [skaes@web.de] 8 9 * Fixed Association#clear for associations which have not yet been accessed. #2524 [Patrick Lenz <patrick@lenz.sh>] 10 11 * HABTM finders shouldn't return readonly records. #2525 [Patrick Lenz <patrick@lenz.sh>] 12 13 * Make all tests runnable on their own. #2521. [Blair Zajac <blair@orcaware.com>] 14 1 15 *1.12.1* (October 19th, 2005) 2 3 * Keep closer tabs on dirty, loaded, and declared fixtures. #2404 [ryand-ruby@zenspider.com]4 5 * Map Active Record time to SQL TIME. #2575, #2576 [Robby Russell <robby@planetargon.com>]6 7 * Clarify semantics of ActiveRecord::Base#respond_to? #2560 [skaes@web.de]8 9 * Fixed Association#clear for associations which have not yet been accessed. #2524 [Patrick Lenz <patrick@lenz.sh>]10 11 * HABTM finders shouldn't return readonly records. #2525 [Patrick Lenz <patrick@lenz.sh>]12 13 * Make all tests runnable on their own. #2521. [Blair Zajac <blair@orcaware.com>]14 16 15 17 * Always parenthesize :conditions options so they may be safely combined with STI and constraints. trunk/activesupport/CHANGELOG
r2690 r2715 1 *SVN* 2 3 * Set Logger.silencer = false to disable Logger#silence. Useful for debugging fixtures. 4 1 5 * Add title case method to String to do, e.g., 'action_web_service'.titlecase # => 'Action Web Service'. [Marcel Molina Jr.] 2 6 trunk/activesupport/lib/active_support/clean_logger.rb
r2553 r2715 1 1 require 'logger' 2 require File.dirname(__FILE__) + '/class_attribute_accessors' 2 3 3 4 class Logger #:nodoc: 5 cattr_accessor :silencer 6 self.silencer = true 7 4 8 # Silences the logger for the duration of the block. 5 9 def silence(temporary_level = Logger::ERROR) 6 old_logger_level, self.level = level, temporary_level 7 yield self 8 ensure 9 self.level = old_logger_level 10 if silencer 11 begin 12 old_logger_level, self.level = level, temporary_level 13 yield self 14 ensure 15 self.level = old_logger_level 16 end 17 else 18 yield self 19 end 10 20 end 11 21 trunk/activesupport/test/clean_logger_test.rb
r2563 r2715 33 33 end 34 34 35 assert_equal "error\nfatal\nerror\nfatal\n", @out.string 35 # Silencer off. 36 Logger.silencer = false 37 @logger.silence do |logger| 38 logger.warn 'unsilenced' 39 end 40 Logger.silencer = true 41 42 assert_equal "error\nfatal\nerror\nfatal\nunsilenced\n", @out.string 36 43 end 37 44 end