Class: Hotspots::Logger
- Inherits:
-
Object
- Object
- Hotspots::Logger
- Defined in:
- lib/hotspots/logger.rb
Overview
TODO : Should understand log levels
Defined Under Namespace
Instance Attribute Summary collapse
-
#colour ⇒ Object
readonly
Returns the value of attribute colour.
-
#sink ⇒ Object
readonly
Returns the value of attribute sink.
Instance Method Summary collapse
- #as_console ⇒ Object
- #colourize ⇒ Object
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
- #log(message, options = {}) ⇒ Object
Constructor Details
Instance Attribute Details
#colour ⇒ Object (readonly)
Returns the value of attribute colour.
31 32 33 |
# File 'lib/hotspots/logger.rb', line 31 def colour @colour end |
#sink ⇒ Object (readonly)
Returns the value of attribute sink.
31 32 33 |
# File 'lib/hotspots/logger.rb', line 31 def sink @sink end |
Instance Method Details
#as_console ⇒ Object
38 39 40 |
# File 'lib/hotspots/logger.rb', line 38 def as_console @sink = Sink::Console end |
#colourize ⇒ Object
42 43 44 45 |
# File 'lib/hotspots/logger.rb', line 42 def colourize require 'ansi/code' @colour = Colour::ANSI end |
#log(message, options = {}) ⇒ Object
47 48 49 |
# File 'lib/hotspots/logger.rb', line 47 def log(, = {}) sink << format(, ) end |