aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/deprecation
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/deprecation')
-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 c531a1aa58..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 = defined?(Rails) ? Rails.logger : 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
}