From fe0ffe406e831378a2864a706e9648b05023df1e Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 27 Sep 2005 20:18:55 +0000 Subject: [PATCH] Ticket 2263 - Make clean logger compatible with both 1.8.2 and 1.8.3 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2369 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/CHANGELOG | 2 ++ activesupport/lib/active_support/clean_logger.rb | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index 3786ee22be..47f791e331 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Clean logger is compatible with both 1.8.2 and 1.8.3 Logger. #2263 [Michael Schuerig ] + * Added native, faster implementations of .blank? for the core types #2286 [skae] * Fixed clean logger to work with Ruby 1.8.3 Logger class #2245 diff --git a/activesupport/lib/active_support/clean_logger.rb b/activesupport/lib/active_support/clean_logger.rb index d0de1188f0..07162f1d44 100644 --- a/activesupport/lib/active_support/clean_logger.rb +++ b/activesupport/lib/active_support/clean_logger.rb @@ -10,7 +10,14 @@ class Logger #:nodoc: end private - def format_message(severity, timestamp, msg, progname) - "#{msg}\n" + # Ruby 1.8.3 swapped the format_message params. + if RUBY_VERSION < '1.8.3' + def format_message(severity, timestamp, msg, progname) + "#{msg}\n" + end + else + def format_message(severity, timestamp, progname, msg) + "#{msg}\n" + end end -end \ No newline at end of file +end