Class: VCAP::Logging::Formatter::BaseFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/vcap/logging/formatter/base_formatter.rb

Overview

Formatters are responsible for taking a log record and producing a string representation suitable for writing to a sink.

Direct Known Subclasses

DelimitedFormatter

Instance Method Summary collapse

Instance Method Details

#format_record(log_record) ⇒ Object

Produces a string suitable for writing to a sink

Parameters:

  • log_record

    VCAP::Logging::LogRecord Log record to be formatted

Returns:

  • String

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/vcap/logging/formatter/base_formatter.rb', line 15

def format_record(log_record)
  raise NotImplementedError
end

#parse_message(message) ⇒ Object

The inverse of format_record()

Parameters:

  • message

    String A string formatted using format_record()

Returns:

  • VCAP::Logging::LogRecord

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/vcap/logging/formatter/base_formatter.rb', line 23

def parse_message(message)
  raise NotImplementedError
end