Module: Dalli

Defined in:
lib/dalli.rb,
lib/dalli/ring.rb,
lib/dalli/client.rb,
lib/dalli/server.rb,
lib/dalli/socket.rb,
lib/dalli/options.rb,
lib/dalli/version.rb,
lib/dalli/protocol.rb,
lib/dalli/compressor.rb,
lib/dalli/key_manager.rb,
lib/dalli/protocol/binary.rb,
lib/dalli/protocol/ttl_sanitizer.rb,
lib/dalli/servers_arg_normalizer.rb,
lib/dalli/protocol/value_compressor.rb,
lib/dalli/protocol/value_marshaller.rb,
lib/dalli/protocol/value_serializer.rb,
lib/dalli/protocol/server_config_parser.rb

Overview

rubocop:disable Style/Documentation

Defined Under Namespace

Modules: Protocol, ServersArgNormalizer, Socket, Threadsafe Classes: Client, Compressor, DalliError, GzipCompressor, KeyManager, MarshalError, NetworkError, Ring, RingError, UnmarshalError, ValueOverMaxSize

Constant Summary collapse

Server =
Protocol::Binary
VERSION =
'3.0.4'

Class Method Summary collapse

Class Method Details

.default_loggerObject


52
53
54
55
56
57
# File 'lib/dalli.rb', line 52

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

.loggerObject


43
44
45
# File 'lib/dalli.rb', line 43

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

.logger=(logger) ⇒ Object


59
60
61
# File 'lib/dalli.rb', line 59

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

.rails_loggerObject


47
48
49
50
# File 'lib/dalli.rb', line 47

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