Class: LogStashLogger::Device::Base
- Inherits:
-
Object
- Object
- LogStashLogger::Device::Base
show all
- Defined in:
- lib/logstash-logger/device/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(opts = {}) ⇒ Base
Returns a new instance of Base.
7
8
9
|
# File 'lib/logstash-logger/device/base.rb', line 7
def initialize(opts={})
@sync = opts[:sync]
end
|
Instance Attribute Details
#io ⇒ Object
Returns the value of attribute io.
4
5
6
|
# File 'lib/logstash-logger/device/base.rb', line 4
def io
@io
end
|
#sync ⇒ Object
Returns the value of attribute sync.
5
6
7
|
# File 'lib/logstash-logger/device/base.rb', line 5
def sync
@sync
end
|
Instance Method Details
#close ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/logstash-logger/device/base.rb', line 23
def close
@io && @io.close
rescue => e
warn "#{self.class} - #{e.class} - #{e.message}"
ensure
@io = nil
end
|
#flush ⇒ Object
19
20
21
|
# File 'lib/logstash-logger/device/base.rb', line 19
def flush
@io && @io.flush
end
|
#to_io ⇒ Object
11
12
13
|
# File 'lib/logstash-logger/device/base.rb', line 11
def to_io
@io
end
|
#write(message) ⇒ Object
15
16
17
|
# File 'lib/logstash-logger/device/base.rb', line 15
def write(message)
@io.write(message)
end
|