Class: BufferedLogger::Formatter
- Inherits:
-
Object
- Object
- BufferedLogger::Formatter
- Includes:
- Term::ANSIColor
- Defined in:
- lib/buffered_logger/formatting.rb
Constant Summary collapse
- FORMAT =
"%s"
- COLOR =
true
Instance Method Summary collapse
-
#%(message) ⇒ Object
formatting.
-
#color? ⇒ Boolean
color accessors.
- #format=(format) ⇒ Object
-
#initialize(params = {}) ⇒ Formatter
constructor
A new instance of Formatter.
-
#to_s ⇒ Object
format accessors.
Constructor Details
Instance Method Details
#%(message) ⇒ Object
formatting
74 75 76 77 |
# File 'lib/buffered_logger/formatting.rb', line 74 def %() = @format % .to_s parse_color() end |
#color? ⇒ Boolean
color accessors
68 69 70 |
# File 'lib/buffered_logger/formatting.rb', line 68 def color? @logger ? @logger.color? : COLOR end |
#format=(format) ⇒ Object
62 63 64 |
# File 'lib/buffered_logger/formatting.rb', line 62 def format=(format) @format = format.to_s end |
#to_s ⇒ Object
format accessors
58 59 60 |
# File 'lib/buffered_logger/formatting.rb', line 58 def to_s @format end |