Class: Moneta::Logger::Format

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

Overview

Standard formatter used by the logger

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Format

Returns a new instance of Format.



8
9
10
11
# File 'lib/moneta/logger.rb', line 8

def initialize(options)
  @prefix = options[:prefix] || 'Moneta '
  @out = options[:out] || STDOUT
end

Instance Method Details

#call(entry) ⇒ Object



13
14
15
# File 'lib/moneta/logger.rb', line 13

def call(entry)
  @out.write(format(entry))
end