Class: LogStashLogger::Device::Unix
- Inherits:
-
Connectable
- Object
- Base
- Connectable
- LogStashLogger::Device::Unix
- Defined in:
- lib/logstash-logger/device/unix.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #connect ⇒ Object
-
#initialize(opts = {}) ⇒ Unix
constructor
A new instance of Unix.
Methods inherited from Connectable
#connected?, #flush, #to_io, #write
Methods inherited from Base
#close, #flush, #to_io, #write
Constructor Details
#initialize(opts = {}) ⇒ Unix
Returns a new instance of Unix.
6 7 8 9 |
# File 'lib/logstash-logger/device/unix.rb', line 6 def initialize(opts={}) super @path = opts[:path] || fail(ArgumentError, "Path is required") end |
Instance Method Details
#connect ⇒ Object
11 12 13 14 15 |
# File 'lib/logstash-logger/device/unix.rb', line 11 def connect @io = ::UNIXSocket.new(@path).tap do |socket| socket.sync = sync unless sync.nil? end end |