Class: Hotspots::Logger
- Inherits:
-
Object
- Object
- Hotspots::Logger
- Defined in:
- lib/hotspots/logger.rb
Overview
:nodoc: all
Defined Under Namespace
Instance Attribute Summary collapse
-
#sink ⇒ Object
readonly
Returns the value of attribute sink.
Instance Method Summary collapse
- #as_console ⇒ Object (also: #set_console)
- #format(message) ⇒ Object
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
-
#log(message) ⇒ Object
compatibility end.
Constructor Details
Instance Attribute Details
#sink ⇒ Object (readonly)
Returns the value of attribute sink.
14 15 16 |
# File 'lib/hotspots/logger.rb', line 14 def sink @sink end |
Instance Method Details
#as_console ⇒ Object Also known as: set_console
19 20 21 |
# File 'lib/hotspots/logger.rb', line 19 def as_console @sink = Console end |
#format(message) ⇒ Object
31 32 33 |
# File 'lib/hotspots/logger.rb', line 31 def format() "[#{Time.now}] #{}\n" end |
#log(message) ⇒ Object
compatibility end
27 28 29 |
# File 'lib/hotspots/logger.rb', line 27 def log() @sink << format() end |