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/version.rb,
lib/dalli/railtie.rb,
lib/dalli/compressor.rb,
lib/dalli/cas/client.rb

Overview

encoding: ascii

Defined Under Namespace

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

Constant Summary

VERSION =
'2.7.2'

Class Method Summary collapse

Class Method Details

.default_loggerObject



31
32
33
34
35
36
# File 'lib/dalli.rb', line 31

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

.loggerObject



22
23
24
# File 'lib/dalli.rb', line 22

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

.logger=(logger) ⇒ Object



38
39
40
# File 'lib/dalli.rb', line 38

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

.rails_loggerObject



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

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