class Hatchet::DelegatingFormatter

Internal: Formatter class that delegates to another formatter implementation. Used within the configuration to make it possible to switch the default formatter at any time.

Attributes

formatter[RW]

Internal: Gets or sets the formatter that is delegated to.

Public Class Methods

new(formatter) click to toggle source

Internal: Creates a new instance.

formatter - The formatter to delegate to initially.

# File lib/hatchet/delegating_formatter.rb, line 18
def initialize(formatter)
  @formatter = formatter
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 as formatted by the formatter being delegated to.

# File lib/hatchet/delegating_formatter.rb, line 30
def format(level, context, message)
  @formatter.format(level, context, message)
end