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.
167 168 169 170 171 |
# File 'lib/omnibus/logger.rb', line 167 def initialize(log, level = :debug) @log = log @level = level @buffer = '' end |
Instance Method Details
#<<(data) ⇒ Object
The live stream operator must respond to <<.
178 179 180 |
# File 'lib/omnibus/logger.rb', line 178 def <<(data) log_lines(data) end |
#inspect ⇒ String
The detailed string representation of this object.
196 197 198 |
# File 'lib/omnibus/logger.rb', line 196 def inspect "#<#{self.class.name} level: #{@level}>" end |
#to_s ⇒ String
The string representation of this object.
187 188 189 |
# File 'lib/omnibus/logger.rb', line 187 def to_s "#<#{self.class.name}>" end |