Class: Cachetastic::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/cachetastic/logger.rb

Overview

This class handles logging for the caches and their adapters. This class exists simply to supply the ability to write to multiple loggers simultaneously from a single call. It also creates a standardized message to write to those loggers.

It is important that any logger type of class you decide to use reponds to the following methods:

fatal(message)
error(message)
warn(message)
info(message)
debug(message)

Constant Summary collapse

LOG_LEVELS =

:nodoc:

[:fatal, :error, :warn, :info, :debug]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*loggers) ⇒ Logger

The initialize method takes an Array of your favorite logger style classes to write to.



21
22
23
# File 'lib/cachetastic/logger.rb', line 21

def initialize(*loggers)
  @loggers = [loggers].flatten
end

Instance Attribute Details

#loggersObject

An Array of ‘real’ loggers to write to.



17
18
19
# File 'lib/cachetastic/logger.rb', line 17

def loggers
  @loggers
end