Class: Moon::Logfmt::KeyValueFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/moon-logfmt/formatter.rb

Overview

Logfmt’s actual formatter, this takes a key and a value and produces a string

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.defaultKeyValueFormatter

Returns the default instance of the key value formatter

Returns:



34
35
36
# File 'lib/moon-logfmt/formatter.rb', line 34

def self.default
  @default ||= new
end

Instance Method Details

#call(key, value) ⇒ String

Default KEY=VALUE formatter

Parameters:

  • key (String)
  • value (String)

Returns:

  • (String)


27
28
29
# File 'lib/moon-logfmt/formatter.rb', line 27

def call(key, value)
  "#{key}=#{value}"
end