Module: Dalli

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

Overview

encoding: ascii

Defined Under Namespace

Modules: Threadsafe Classes: Client, Compressor, DalliError, GzipCompressor, MarshalError, NetworkError, Railtie, Ring, RingError, Server, UnmarshalError, ValueOverMaxSize

Constant Summary collapse

VERSION =
'2.7.6'

Class Method Summary collapse

Class Method Details

.default_loggerObject


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

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

.loggerObject


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

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

.logger=(logger) ⇒ Object


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

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

.rails_loggerObject


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

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