class Hatchet::PlainFormatter

Public: Plain formatter class. Outputs messages with just the given message.

Useful for Rails in development mode where the log messages are intended to be human readable rather than useful for grepping, etc.

Public Class Methods

new() click to toggle source

Public: Initialize a new instance.

# File lib/hatchet/plain_formatter.rb, line 14
def initialize
  @backtrace = true
end

Public Instance Methods

format(level, context, message) click to toggle source

Public: Returns the formatted message.

level - The severity of the log message. context - The context of the log message. message - The message provided by the log caller.

Returns messages in the format:

MESSAGE
    BACKTRACE

The backtrace is only present if the message contains an error.

# File lib/hatchet/plain_formatter.rb, line 31
def format(level, context, message)
  with_backtrace(message, message.to_s)
end