lib/loggable/log_methods.rb in mediashelf-loggable-0.4.1 vs lib/loggable/log_methods.rb in mediashelf-loggable-0.4.2

- old
+ new

@@ -17,10 +17,10 @@ # If RAILS_DEFAULT_LOGGER is defined, that will be returned. # If no logger has been defined, a new STDOUT Logger will be created. def logger # @@logger || LoggerStub.new - @@logger ||= !::Rails.logger.nil? ? ::Rails.logger : ::Logger.new(STDOUT) + @@logger ||= (defined?(::Rails) && !::Rails.logger.nil?) ? ::Rails.logger : ::Logger.new(STDOUT) end end module InstanceMethods \ No newline at end of file