Class: PVN::Log::MessageFormatter

Inherits:
Formatter show all
Defined in:
lib/pvn/log/formatter/message_formatter.rb

Constant Summary

Constants inherited from Formatter

Formatter::COLORS, Formatter::WIDTHS

Instance Attribute Summary

Attributes inherited from Formatter

#use_colors

Instance Method Summary collapse

Methods inherited from Formatter

#colors, #width

Methods inherited from ColorFormatter

#add_field, #colorize, #pad

Constructor Details

#initialize(use_colors, msg) ⇒ MessageFormatter

Returns a new instance of MessageFormatter.



10
11
12
13
# File 'lib/pvn/log/formatter/message_formatter.rb', line 10

def initialize use_colors, msg
  super use_colors
  @msg = msg
end

Instance Method Details

#formatObject



15
16
17
# File 'lib/pvn/log/formatter/message_formatter.rb', line 15

def format
  use_colors ? @msg.color(:white) : @msg
end