Class: Juno::Logger

Inherits:
Proxy show all
Defined in:
lib/juno/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 Base

#[], #[]=, #fetch

Constructor Details

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

Constructor

Options:

  • :logger - Callable logger object (default Juno::Logger::Format)

  • :logprefix - Prefix string (default ‘Juno ’)

  • :logout - Output (default STDOUT)

Parameters:

  • adapter (Juno store)

    The underlying store

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


45
46
47
48
# File 'lib/juno/logger.rb', line 45

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

Instance Method Details

#clear(options = {}) ⇒ Object



66
67
68
69
# File 'lib/juno/logger.rb', line 66

def clear(options = {})
  log(:clear, options) { super; nil }
  self
end

#closeObject



71
72
73
# File 'lib/juno/logger.rb', line 71

def close
  log(:close) { super }
end

#delete(key, options = {}) ⇒ Object



62
63
64
# File 'lib/juno/logger.rb', line 62

def delete(key, options = {})
  log(:delete, key, options) { super }
end

#key?(key, options = {}) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/juno/logger.rb', line 50

def key?(key, options = {})
  log(:key?, key, options) { super }
end

#load(key, options = {}) ⇒ Object



54
55
56
# File 'lib/juno/logger.rb', line 54

def load(key, options = {})
  log(:load, key, options) { super }
end

#store(key, value, options = {}) ⇒ Object



58
59
60
# File 'lib/juno/logger.rb', line 58

def store(key, value, options = {})
  log(:store, key, value, options) { super }
end