Class: Logbert::Handlers::StreamHandler

Inherits:
BaseHandler show all
Defined in:
lib/logbert/handlers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseHandler

#formatter, #formatter=, #publish

Constructor Details

#initialize(stream = $stderr) ⇒ StreamHandler

Returns a new instance of StreamHandler.



33
34
35
# File 'lib/logbert/handlers.rb', line 33

def initialize(stream = $stderr)
  @stream = stream
end

Instance Attribute Details

#stream ⇒ Object

Returns the value of attribute stream.



31
32
33
# File 'lib/logbert/handlers.rb', line 31

def stream
  @stream
end

Instance Method Details

#emit(output) ⇒ Object



37
38
39
# File 'lib/logbert/handlers.rb', line 37

def emit(output)
  @stream.puts output
end