Class: Log4r::RemoteOutputter

Inherits:
Outputter
  • Object
show all
Includes:
ROMPClient
Defined in:
lib/log4r-color/outputter/remoteoutputter.rb

Overview

See log4r-color/logserver.rb

Instance Attribute Summary

Attributes inherited from Outputter

#colors, #formatter, #level, #name

Instance Method Summary collapse

Methods inherited from Outputter

[], []=, color, each, each_outputter, #level_key, #only_at, stderr, stdout

Constructor Details

#initialize(*args) ⇒ RemoteOutputter

Returns a new instance of RemoteOutputter.

Raises:

  • (RuntimeError)


9
10
11
12
13
14
15
# File 'lib/log4r-color/outputter/remoteoutputter.rb', line 9

def initialize(_name, hash={})
  super(_name, hash)
  @uri = (hash[:uri] or hash['uri'])
  @buffsize = (hash[:buffsize] or hash['buffsize'] or 1).to_i
  @buff = []
  connect
end

Instance Method Details

#flushObject

Call flush to send any remaining LogEvents to the remote server.



27
28
29
# File 'lib/log4r-color/outputter/remoteoutputter.rb', line 27

def flush
  synch { send_buffer }
end