1
0
mirror of https://github.com/meineerde/rackstash.git synced 2025-10-17 14:01:01 +00:00

Add Rack::Errors#close to satisfy the expected protocol for a logdev of Ruby's core Logger

This commit is contained in:
Holger Just 2018-07-17 22:53:54 +02:00
parent 78f3e037e7
commit b646ef9ef1
2 changed files with 13 additions and 0 deletions

View File

@ -30,6 +30,12 @@ module Rackstash
@logger = logger
end
# Close the {logger} and all of its adapters
# @return [void]
def close
@logger.close
end
# Log a formatted error message to the current buffer of the `logger`. We
# will format the given message and log it with an `UNKNOWN` severity to
# the current buffer. Usually, the logger's formatter adds a trailing

View File

@ -53,4 +53,11 @@ RSpec.describe Rackstash::Rack::Errors do
errors.flush
end
end
describe '#close' do
it 'closes the logger' do
expect(logger).to receive(:close)
errors.close
end
end
end