mirror of
https://github.com/meineerde/rackstash.git
synced 2025-10-17 14:01:01 +00:00
Forward Logger#close and Logger#reopen to the Sink
This commit is contained in:
parent
40f920dafb
commit
fc4a917b71
@ -102,6 +102,11 @@ module Rackstash
|
||||
end
|
||||
end
|
||||
|
||||
# (see Sink#close)
|
||||
def close
|
||||
@sink.close
|
||||
end
|
||||
|
||||
# (see Sink#default_fields)
|
||||
def default_fields
|
||||
@sink.default_fields
|
||||
@ -133,6 +138,11 @@ module Rackstash
|
||||
@sink.flows
|
||||
end
|
||||
|
||||
# (see Sink#reopen)
|
||||
def reopen
|
||||
@sink.reopen
|
||||
end
|
||||
|
||||
# (see Buffer#tags)
|
||||
def tags
|
||||
buffer.tags
|
||||
|
||||
@ -38,6 +38,13 @@ describe Rackstash::Logger do
|
||||
end
|
||||
end
|
||||
|
||||
describe '#close' do
|
||||
it 'forwards to the sink' do
|
||||
expect(logger.sink).to receive(:close)
|
||||
logger.close
|
||||
end
|
||||
end
|
||||
|
||||
describe '#default_fields' do
|
||||
it 'forwards to the sink' do
|
||||
expect(logger.sink).to receive(:default_fields)
|
||||
@ -73,7 +80,6 @@ describe Rackstash::Logger do
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
describe '#formatter' do
|
||||
it 'defaults to a Rackstash::Formatter' do
|
||||
expect(logger.formatter).to be_a Rackstash::Formatter
|
||||
@ -160,6 +166,13 @@ describe Rackstash::Logger do
|
||||
end
|
||||
end
|
||||
|
||||
describe '#reopen' do
|
||||
it 'forwards to the sink' do
|
||||
expect(logger.sink).to receive(:reopen)
|
||||
logger.reopen
|
||||
end
|
||||
end
|
||||
|
||||
describe '#sink' do
|
||||
it 'returns the created sink' do
|
||||
expect(logger.sink).to be_a Rackstash::Sink
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user