From 9daddf0116f2e88153e4473bb9aa5b8edc186963 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 8 Feb 2007 00:17:39 +0000 Subject: Deprecation: warn on stderr if RAILS_DEFAULT_LOGGER isn't set yet. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6140 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/CHANGELOG | 6 ++++-- activesupport/lib/active_support/deprecation.rb | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'activesupport') diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index 0add31cb50..114ce90c1e 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -1,9 +1,11 @@ *SVN* +* Deprecation: warn on stderr if RAILS_DEFAULT_LOGGER isn't set yet. [Jeremy +Kemper] + * Optimize Class Inheritable Attributes so that unnecessary hashes are not created. Closes #7472 [Bruce Perens] -* Ruby 1.8-cvs and 1.9 define a private Time#to_date that overrides Active -Support. Make it public to preserve compatibility. [Jeremy Kemper] +* Ruby 1.8-cvs and 1.9 define a private Time#to_date that overrides Active Support. Make it public to preserve compatibility. [Jeremy Kemper] * Full test coverage for Inflector. #7228 [Dan Kubb] diff --git a/activesupport/lib/active_support/deprecation.rb b/activesupport/lib/active_support/deprecation.rb index d2c6127461..8499ad6e2d 100644 --- a/activesupport/lib/active_support/deprecation.rb +++ b/activesupport/lib/active_support/deprecation.rb @@ -13,8 +13,9 @@ module ActiveSupport $stderr.puts callstack.join("\n ") if debug }, 'development' => Proc.new { |message, callstack| - RAILS_DEFAULT_LOGGER.warn message - RAILS_DEFAULT_LOGGER.debug callstack.join("\n ") if debug + logger = defined?(::RAILS_DEFAULT_LOGGER) ? ::RAILS_DEFAULT_LOGGER : Logger.new($stderr) + logger.warn message + logger.debug callstack.join("\n ") if debug } } -- cgit v1.2.3