Class: Pronto::Formatter::TextFormatter

Inherits:
Object
  • Object
show all
Includes:
Colorizable
Defined in:
lib/pronto/formatter/text_formatter.rb

Constant Summary collapse

LOCATION_COLOR =
:cyan
LEVEL_COLORS =
{
  info: :yellow,
  warning: :magenta,
  error: :red,
  fatal: :red
}.freeze

Instance Method Summary collapse

Methods included from Colorizable

#colorize

Instance Method Details

#format(messages, _, _) ⇒ Object



15
16
17
18
19
# File 'lib/pronto/formatter/text_formatter.rb', line 15

def format(messages, _, _)
  messages.map do |message|
    "#{format_location(message)} #{format_level(message)}: #{message.msg}".strip
  end
end