Module: Dalli

Defined in:
lib/dalli.rb,
lib/dalli/ring.rb,
lib/dalli/client.rb,
lib/dalli/server.rb,
lib/dalli/options.rb,
lib/dalli/version.rb

Defined Under Namespace

Modules: Threadsafe Classes: Client, DalliError, MarshalError, NetworkError, Ring, RingError, Server

Constant Summary collapse

VERSION =
'1.0.3'

Class Method Summary collapse

Class Method Details

.default_loggerObject



33
34
35
36
37
38
# File 'lib/dalli.rb', line 33

def self.default_logger
  require 'logger'
  l = Logger.new(STDOUT)
  l.level = Logger::INFO
  l
end

.loggerObject



24
25
26
# File 'lib/dalli.rb', line 24

def self.logger
  @logger ||= (rails_logger || default_logger)
end

.logger=(logger) ⇒ Object



40
41
42
# File 'lib/dalli.rb', line 40

def self.logger=(logger)
  @logger = logger
end

.rails_loggerObject



28
29
30
31
# File 'lib/dalli.rb', line 28

def self.rails_logger
  (defined?(Rails) && Rails.respond_to?(:logger) && Rails.logger) ||
  (defined?(RAILS_DEFAULT_LOGGER) && RAILS_DEFAULT_LOGGER.respond_to?(:debug) && RAILS_DEFAULT_LOGGER)
end