Class: Omnibus::Logger::LiveStream
- Inherits:
-
Object
- Object
- Omnibus::Logger::LiveStream
- Defined in:
- lib/omnibus/logger.rb
Overview
This is a magical wrapper around the logger that chunks data to not look like absolute shit.
Instance Method Summary collapse
-
#<<(data) ⇒ Object
The live stream operator must respond to <<.
-
#initialize(log, level = :debug) ⇒ LiveStream
constructor
Create a new LiveStream logger.
-
#inspect ⇒ String
The detailed string representation of this object.
-
#to_s ⇒ String
The string representation of this object.
Constructor Details
#initialize(log, level = :debug) ⇒ LiveStream
Create a new LiveStream logger.
171 172 173 174 175 |
# File 'lib/omnibus/logger.rb', line 171 def initialize(log, level = :debug) @log = log @level = level @buffer = "" end |
Instance Method Details
#<<(data) ⇒ Object
The live stream operator must respond to <<.
182 183 184 |
# File 'lib/omnibus/logger.rb', line 182 def <<(data) log_lines(data) end |
#inspect ⇒ String
The detailed string representation of this object.
200 201 202 |
# File 'lib/omnibus/logger.rb', line 200 def inspect "#<#{self.class.name} level: #{@level}>" end |
#to_s ⇒ String
The string representation of this object.
191 192 193 |
# File 'lib/omnibus/logger.rb', line 191 def to_s "#<#{self.class.name}>" end |