Class: Machines::Logger
- Inherits:
-
Object
- Object
- Machines::Logger
- Defined in:
- lib/machines/logger.rb
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(to, options = {}) ⇒ Logger
constructor
A new instance of Logger.
-
#log(message, options = {}) ⇒ Object
Logs a message.
Constructor Details
#initialize(to, options = {}) ⇒ Logger
Returns a new instance of Logger.
11 12 13 14 |
# File 'lib/machines/logger.rb', line 11 def initialize to, = {} @to = to @truncate = [:truncate] end |
Instance Method Details
#flush ⇒ Object
27 28 29 |
# File 'lib/machines/logger.rb', line 27 def flush @to.flush end |
#log(message, options = {}) ⇒ Object
Logs a message
22 23 24 25 |
# File 'lib/machines/logger.rb', line 22 def log , = {} = (, ) @to.print end |