Class: PVN::Log::Formatter
- Inherits:
-
ColorFormatter
- Object
- ColorFormatter
- PVN::Log::Formatter
- Defined in:
- lib/pvn/log/formatter/log_formatter.rb
Overview
a format for log entries
Direct Known Subclasses
EntriesFormatter, EntryFormatter, MessageFormatter, PathFormatter, SummaryFormatter
Constant Summary collapse
- WIDTHS =
{ :revision => 10, :neg_revision => 5, :pos_revision => 5, :author => 25 }
- COLORS =
{ :revision => [ :bold ], :neg_revision => [ :bold ], :pos_revision => [ :bold ], :author => [ :bold, :cyan ], :date => [ :bold, :magenta ], :added => [ :green ], :modified => [ :yellow ], :deleted => [ :red ], :renamed => [ :magenta ], :dir => [ :bold ], }
Instance Attribute Summary collapse
-
#use_colors ⇒ Object
readonly
Returns the value of attribute use_colors.
Instance Method Summary collapse
- #colors(field) ⇒ Object
-
#initialize(use_colors) ⇒ Formatter
constructor
A new instance of Formatter.
- #width(field) ⇒ Object
Methods inherited from ColorFormatter
Constructor Details
#initialize(use_colors) ⇒ Formatter
Returns a new instance of Formatter.
37 38 39 40 |
# File 'lib/pvn/log/formatter/log_formatter.rb', line 37 def initialize use_colors @use_colors = use_colors # should also turn this off if not on a terminal that supports colors ... end |
Instance Attribute Details
#use_colors ⇒ Object (readonly)
Returns the value of attribute use_colors.
35 36 37 |
# File 'lib/pvn/log/formatter/log_formatter.rb', line 35 def use_colors @use_colors end |