Class: Restash::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/restash/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(host, port, options) ⇒ Logger

Returns a new instance of Logger.



6
7
8
9
10
# File 'lib/restash/logger.rb', line 6

def initialize(host, port, options)
  @host = host
  @port = port
  @options = options
end

Instance Method Details

#write(data) ⇒ Object



12
13
14
15
16
# File 'lib/restash/logger.rb', line 12

def write(data)
  sock = TCPTimeout::TCPSocket.new(@host, @port, @options)
  sock.write(data)
  sock.close
end