Skip to content

Instantly share code, notes, and snippets.

@NZKoz
Created November 19, 2009 01:19
Show Gist options
  • Select an option

  • Save NZKoz/238449 to your computer and use it in GitHub Desktop.

Select an option

Save NZKoz/238449 to your computer and use it in GitHub Desktop.
diff --git a/activesupport/lib/active_support/deprecation.rb b/activesupport/lib/active_support/deprecation.rb
index 540be29..151ae5a 100644
--- a/activesupport/lib/active_support/deprecation.rb
+++ b/activesupport/lib/active_support/deprecation.rb
@@ -13,7 +13,7 @@ module ActiveSupport
$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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment