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:
parent
5213574ec7
commit
9536b0473b
@ -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)
|
||||||
|
|||||||
@ -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) { [] }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user