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

Forward Logger#timestamp to Buffer#timestamp

This commit is contained in:
Holger Just 2017-07-21 18:34:29 +02:00
parent 5213574ec7
commit 9536b0473b
2 changed files with 20 additions and 0 deletions

View File

@ -150,6 +150,11 @@ module Rackstash
buffer.tags buffer.tags
end end
# (see Buffer#timestamp)
def timestamp(time = nil)
buffer.timestamp(time)
end
# Log a message at the DEBUG log level. # Log a message at the DEBUG log level.
# #
# @param msg (see #add) # @param msg (see #add)

View File

@ -222,6 +222,21 @@ describe Rackstash::Logger do
end end
end end
describe '#timestamp' do
it 'forwards to the Buffer' do
buffer = instance_double('Rackstash::Buffer')
expect(logger).to receive(:buffer).and_return(buffer)
expect(buffer).to receive(:timestamp)
logger.timestamp
end
it 'implements the same method signature as the Buffer' do
expect(Rackstash::Buffer.instance_method(:timestamp).parameters)
.to eql logger.method(:timestamp).parameters
end
end
describe '#add' do describe '#add' do
let(:messages) { [] } let(:messages) { [] }