Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle a nil logger when generating Deprecation warnings

  • Loading branch information...
commit 93085a7d6cd05c50a982f5beca94d7072208374c 1 parent a942d66
@NZKoz NZKoz authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  activesupport/lib/active_support/deprecation.rb
View
2  activesupport/lib/active_support/deprecation.rb
@@ -13,7 +13,7 @@ module Deprecation #:nodoc:
$stderr.puts callstack.join("\n ") if debug
},
'development' => Proc.new { |message, callstack|
- logger = defined?(Rails) ? Rails.logger : Logger.new($stderr)
+ logger = (defined?(Rails) && Rails.logger) ? Rails.logger : Logger.new($stderr)
logger.warn message
logger.debug callstack.join("\n ") if debug
}

0 comments on commit 93085a7

Please sign in to comment.
Something went wrong with that request. Please try again.