aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/deprecation/behaviors.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/deprecation/behaviors.rb')
-rw-r--r--activesupport/lib/active_support/deprecation/behaviors.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/deprecation/behaviors.rb b/activesupport/lib/active_support/deprecation/behaviors.rb
index 0c065fb103..ca23d45666 100644
--- a/activesupport/lib/active_support/deprecation/behaviors.rb
+++ b/activesupport/lib/active_support/deprecation/behaviors.rb
@@ -23,7 +23,13 @@ module ActiveSupport
$stderr.puts callstack.join("\n ") if debug
},
'development' => Proc.new { |message, callstack|
- logger = (Rails.logger if defined?(Rails)) || Logger.new($stderr)
+ logger =
+ if defined?(Rails) && Rails.logger
+ Rails.logger
+ else
+ require 'logger'
+ Logger.new($stderr)
+ end
logger.warn message
logger.debug callstack.join("\n ") if debug
}