From a9f9ae385e2145b7f0d1ae43a7b66ed280b220b9 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 14 Oct 2009 17:54:45 -0700 Subject: [PATCH] Explicitly require logger --- activesupport/lib/active_support/deprecation/behaviors.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 @@ def default_behavior $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 } -- GitLab