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.
13 14 15 16 |
# File 'lib/machines/logger.rb', line 13 def initialize to, = {} @to = to @truncate = [:truncate] end |
Instance Method Details
#flush ⇒ Object
29 30 31 |
# File 'lib/machines/logger.rb', line 29 def flush @to.flush end |
#log(message, options = {}) ⇒ Object
Logs a message
24 25 26 27 |
# File 'lib/machines/logger.rb', line 24 def log , = {} = (, ) @to.print end |