Class: Moneta::Logger

Inherits:
Wrapper show all
Defined in:
lib/moneta/logger.rb

Overview

Logger proxy

Defined Under Namespace

Classes: Format

Instance Attribute Summary

Attributes inherited from Proxy

#adapter

Instance Method Summary collapse

Methods inherited from Wrapper

#clear, #close, #delete, #increment, #key?, #load, #store

Methods inherited from Proxy

#clear, #close, #delete, #increment, #key?, #load, #store

Methods included from Defaults

#[], #[]=, #close, #decrement, #fetch, #increment, #key?

Methods included from OptionSupport

#expires, #prefix, #raw, #with

Constructor Details

#initialize(adapter, options = {}) ⇒ Logger

Returns a new instance of Logger

Parameters:

  • adapter (Moneta store)

    The underlying store

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :logger (Object) — default: Moneta::Logger::Format

    Callable logger object

  • :logprefix (String) — default: 'Moneta '

    Prefix string

  • :logout (IO) — default: STDOUT

    Output


41
42
43
44
# File 'lib/moneta/logger.rb', line 41

def initialize(adapter, options = {})
  super
  @logger = options[:logger] || Format.new(options)
end