Changeset 2553
- Timestamp:
- 10/13/05 19:05:32 (4 years ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/clean_logger.rb (modified) (2 diffs)
- trunk/activesupport/test/clean_logger_test.rb (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r2512 r2553 1 1 *SVN* 2 3 * Fix Logger compatibility for distributions that don't keep Ruby and its standard library in sync. 2 4 3 5 * Replace '%e' from long and short time formats as Windows does not support it. #2344. [Tom Ward <tom@popdog.net>] trunk/activesupport/lib/active_support/clean_logger.rb
r2369 r2553 5 5 def silence(temporary_level = Logger::ERROR) 6 6 old_logger_level, self.level = level, temporary_level 7 yield 7 yield self 8 8 ensure 9 9 self.level = old_logger_level … … 11 11 12 12 private 13 # Ruby 1.8.3 swapped the format_message params. 14 if RUBY_VERSION < '1.8.3' 15 def format_message(severity, timestamp, msg, progname) 13 # Ruby 1.8.3 transposed the msg and progname arguments to format_message. 14 # We can't test RUBY_VERSION because some distributions don't keep Ruby 15 # and its standard library in sync, leading to installations of Ruby 1.8.2 16 # with Logger from 1.8.3 and vice versa. 17 if method_defined?(:formatter=) 18 def format_message(severity, timestamp, progname, msg) 16 19 "#{msg}\n" 17 20 end 18 21 else 19 def format_message(severity, timestamp, progname, msg)22 def format_message(severity, timestamp, msg, progname) 20 23 "#{msg}\n" 21 24 end