Class: Statistrano::Log::DefaultLogger::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/statistrano/log/default_logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, color, *msg) ⇒ Formatter

Returns a new instance of Formatter.



57
58
59
60
61
62
# File 'lib/statistrano/log/default_logger.rb', line 57

def initialize status, color, *msg
  @width  = 14
  @status = status.to_s
  @color  = color
  @msgs   = msg
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



55
56
57
# File 'lib/statistrano/log/default_logger.rb', line 55

def color
  @color
end

#msgsObject (readonly)

Returns the value of attribute msgs.



55
56
57
# File 'lib/statistrano/log/default_logger.rb', line 55

def msgs
  @msgs
end

#statusObject (readonly)

Returns the value of attribute status.



55
56
57
# File 'lib/statistrano/log/default_logger.rb', line 55

def status
  @status
end

#widthObject (readonly)

Returns the value of attribute width.



55
56
57
# File 'lib/statistrano/log/default_logger.rb', line 55

def width
  @width
end

Instance Method Details

#outputObject



64
65
66
# File 'lib/statistrano/log/default_logger.rb', line 64

def output
  Rainbow(anchor).bright + padding + Rainbow(status).public_send(color) + formatted_messages
end