logstash-core 5.0.0.alpha6.snapshot1-java → 5.0.0.alpha6.snapshot2-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of logstash-core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/jars.rb +7 -0
- data/lib/logstash-core/version.rb +1 -1
- data/lib/logstash/agent.rb +2 -2
- data/lib/logstash/api/rack_app.rb +14 -15
- data/lib/logstash/config/config_ast.rb +2 -2
- data/lib/logstash/config/file.rb +1 -2
- data/lib/logstash/config/mixin.rb +9 -11
- data/lib/logstash/environment.rb +2 -1
- data/lib/logstash/filters/base.rb +1 -0
- data/lib/logstash/inputs/base.rb +1 -0
- data/lib/logstash/java_integration.rb +1 -0
- data/lib/logstash/logging.rb +1 -89
- data/lib/logstash/logging/json.rb +1 -1
- data/lib/logstash/logging/logger.rb +72 -0
- data/lib/logstash/output_delegator.rb +8 -16
- data/lib/logstash/output_delegator_strategies/legacy.rb +2 -1
- data/lib/logstash/output_delegator_strategies/shared.rb +1 -0
- data/lib/logstash/output_delegator_strategies/single.rb +1 -0
- data/lib/logstash/outputs/base.rb +5 -0
- data/lib/logstash/patches/clamp.rb +21 -0
- data/lib/logstash/pipeline.rb +24 -24
- data/lib/logstash/pipeline_reporter.rb +1 -1
- data/lib/logstash/plugin.rb +3 -10
- data/lib/logstash/plugins/registry.rb +3 -1
- data/lib/logstash/runner.rb +47 -74
- data/lib/logstash/shutdown_watcher.rb +1 -8
- data/lib/logstash/util/decorators.rb +3 -4
- data/lib/logstash/util/java_version.rb +0 -5
- data/lib/logstash/util/loggable.rb +7 -17
- data/lib/logstash/util/safe_uri.rb +2 -0
- data/lib/logstash/util/wrapped_synchronous_queue.rb +5 -5
- data/lib/logstash/version.rb +1 -1
- data/locales/en.yml +19 -8
- data/logstash-core.gemspec +4 -3
- data/spec/api/lib/rack_app_spec.rb +6 -4
- data/spec/logstash/config/loader_spec.rb +3 -1
- data/spec/logstash/config/mixin_spec.rb +28 -9
- data/spec/logstash/output_delegator_spec.rb +15 -2
- data/spec/logstash/outputs/base_spec.rb +0 -1
- data/spec/logstash/pipeline_reporter_spec.rb +1 -0
- data/spec/logstash/pipeline_spec.rb +14 -2
- data/spec/logstash/plugin_spec.rb +7 -6
- data/spec/logstash/runner_spec.rb +62 -44
- data/spec/logstash/shutdown_watcher_spec.rb +0 -4
- metadata +21 -18
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
module LogStash
|
4
4
|
class ShutdownWatcher
|
5
|
+
include LogStash::Util::Loggable
|
5
6
|
|
6
7
|
CHECK_EVERY = 1 # second
|
7
8
|
REPORT_EVERY = 5 # checks
|
@@ -25,14 +26,6 @@ module LogStash
|
|
25
26
|
@unsafe_shutdown
|
26
27
|
end
|
27
28
|
|
28
|
-
def self.logger=(logger)
|
29
|
-
@logger = logger
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.logger
|
33
|
-
@logger ||= Cabin::Channel.get(LogStash)
|
34
|
-
end
|
35
|
-
|
36
29
|
def self.start(pipeline, cycle_period=CHECK_EVERY, report_every=REPORT_EVERY, abort_threshold=ABORT_AFTER)
|
37
30
|
controller = self.new(pipeline, cycle_period, report_every, abort_threshold)
|
38
31
|
Thread.new(controller) { |controller| controller.start }
|
@@ -6,10 +6,9 @@ module LogStash::Util
|
|
6
6
|
|
7
7
|
# Decorators provides common manipulation on the event data.
|
8
8
|
module Decorators
|
9
|
+
include LogStash::Util::Loggable
|
9
10
|
extend self
|
10
11
|
|
11
|
-
@logger = Cabin::Channel.get(LogStash)
|
12
|
-
|
13
12
|
# fields is a hash of field => value
|
14
13
|
# where both `field` and `value` can use sprintf syntax.
|
15
14
|
def add_fields(fields,event, pluginname)
|
@@ -28,7 +27,7 @@ module LogStash::Util
|
|
28
27
|
else
|
29
28
|
event.set(field, v)
|
30
29
|
end
|
31
|
-
|
30
|
+
self.logger.debug? and self.logger.debug("#{pluginname}: adding value to field", "field" => field, "value" => value)
|
32
31
|
end
|
33
32
|
end
|
34
33
|
end
|
@@ -37,7 +36,7 @@ module LogStash::Util
|
|
37
36
|
def add_tags(tags, event, pluginname)
|
38
37
|
tags.each do |tag|
|
39
38
|
tag = event.sprintf(tag)
|
40
|
-
|
39
|
+
self.logger.debug? and self.logger.debug("#{pluginname}: adding tag", "tag" => tag)
|
41
40
|
# note below that the tags array field needs to be updated then reassigned to the event.
|
42
41
|
# this is important because a construct like event["tags"] << tag will not work
|
43
42
|
# in the current Java event implementation. see https://github.com/elastic/logstash/issues/4140
|
@@ -1,11 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require 'cabin'
|
3
2
|
|
4
3
|
module LogStash::Util::JavaVersion
|
5
|
-
def self.logger
|
6
|
-
@logger ||= Cabin::Channel.get(LogStash)
|
7
|
-
end
|
8
|
-
|
9
4
|
# Return the current java version string. Returns nil if this is a non-java platform (e.g. MRI).
|
10
5
|
def self.version
|
11
6
|
return nil unless LogStash::Environment.jruby?
|
@@ -1,29 +1,19 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
require "logstash/logging/logger"
|
2
3
|
require "logstash/namespace"
|
3
|
-
require "cabin"
|
4
4
|
|
5
5
|
module LogStash module Util
|
6
6
|
module Loggable
|
7
|
-
|
8
|
-
def logger
|
9
|
-
|
7
|
+
def self.included(klass)
|
8
|
+
def klass.logger
|
9
|
+
ruby_name = self.name || self.class.name || self.class.to_s
|
10
|
+
log4j_name = ruby_name.gsub('::', '.').downcase
|
11
|
+
@logger ||= LogStash::Logging::Logger.new(log4j_name)
|
10
12
|
end
|
11
13
|
|
12
14
|
def logger
|
13
|
-
|
15
|
+
self.class.logger
|
14
16
|
end
|
15
17
|
end
|
16
|
-
|
17
|
-
def self.included(base)
|
18
|
-
class << base
|
19
|
-
def logger
|
20
|
-
Loggable.logger
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def logger
|
26
|
-
Loggable.logger
|
27
|
-
end
|
28
18
|
end
|
29
19
|
end; end
|
@@ -6,6 +6,7 @@ require "logstash/util"
|
|
6
6
|
# logged, you don't accidentally print the password itself.
|
7
7
|
class LogStash::Util::SafeURI
|
8
8
|
PASS_PLACEHOLDER = "xxxxxx".freeze
|
9
|
+
HOSTNAME_PORT_REGEX=/\A(?<hostname>([A-Za-z0-9\.\-]+)|\[[0-9A-Fa-f\:]+\])(:(?<port>\d+))?\Z/
|
9
10
|
|
10
11
|
extend Forwardable
|
11
12
|
|
@@ -17,6 +18,7 @@ class LogStash::Util::SafeURI
|
|
17
18
|
def initialize(arg)
|
18
19
|
@uri = case arg
|
19
20
|
when String
|
21
|
+
arg = "//#{arg}" if HOSTNAME_PORT_REGEX.match(arg)
|
20
22
|
URI.parse(arg)
|
21
23
|
when URI
|
22
24
|
arg
|
@@ -218,16 +218,16 @@ module LogStash; module Util
|
|
218
218
|
if event.nil?
|
219
219
|
# queue poll timed out
|
220
220
|
next
|
221
|
-
elsif event
|
221
|
+
elsif event.is_a?(LogStash::SignalEvent)
|
222
222
|
# We MUST break here. If a batch consumes two SHUTDOWN events
|
223
223
|
# then another worker may have its SHUTDOWN 'stolen', thus blocking
|
224
224
|
# the pipeline.
|
225
|
-
@shutdown_signal_received =
|
226
|
-
|
227
|
-
elsif event == LogStash::FLUSH
|
225
|
+
@shutdown_signal_received = event.shutdown?
|
226
|
+
|
228
227
|
# See comment above
|
229
228
|
# We should stop doing work after flush as well.
|
230
|
-
@flush_signal_received =
|
229
|
+
@flush_signal_received = event.flush?
|
230
|
+
|
231
231
|
break
|
232
232
|
else
|
233
233
|
@originals[event] = true
|
data/lib/logstash/version.rb
CHANGED
data/locales/en.yml
CHANGED
@@ -86,10 +86,10 @@ en:
|
|
86
86
|
runner:
|
87
87
|
short-help: |-
|
88
88
|
usage:
|
89
|
-
bin/logstash -f CONFIG_PATH [-t] [-r] [
|
90
|
-
bin/logstash -e CONFIG_STR [-t] [--
|
91
|
-
bin/logstash -i SHELL [--
|
92
|
-
bin/logstash -V [--
|
89
|
+
bin/logstash -f CONFIG_PATH [-t] [-r] [] [-w COUNT] [-l LOG]
|
90
|
+
bin/logstash -e CONFIG_STR [-t] [--log.level fatal|error|warn|info|debug|trace] [-w COUNT] [-l LOG]
|
91
|
+
bin/logstash -i SHELL [--log.level fatal|error|warn|info|debug|trace]
|
92
|
+
bin/logstash -V [--log.level fatal|error|warn|info|debug|trace]
|
93
93
|
bin/logstash --help
|
94
94
|
invalid-configuration: >-
|
95
95
|
The given configuration is invalid. Reason: %{error}
|
@@ -228,10 +228,12 @@ en:
|
|
228
228
|
and NAME is the name of the plugin.
|
229
229
|
log_level: |+
|
230
230
|
Set the log level for logstash. Possible values are:
|
231
|
-
-
|
232
|
-
-
|
233
|
-
-
|
234
|
-
-
|
231
|
+
- fatal
|
232
|
+
- error
|
233
|
+
- warn
|
234
|
+
- info
|
235
|
+
- debug
|
236
|
+
- trace
|
235
237
|
unsafe_shutdown: |+
|
236
238
|
Force logstash to exit during shutdown even
|
237
239
|
if there are still inflight events in memory.
|
@@ -252,3 +254,12 @@ en:
|
|
252
254
|
log_format: |+
|
253
255
|
Specify if Logstash should write its own logs in JSON form (one
|
254
256
|
event per line) or in plain text (using Ruby's Object#inspect)
|
257
|
+
debug: |+
|
258
|
+
Set the log level to debug.
|
259
|
+
DEPRECATED: use --log.level=debug instead.
|
260
|
+
verbose: |+
|
261
|
+
Set the log level to info.
|
262
|
+
DEPRECATED: use --log.level=verbose instead.
|
263
|
+
quiet: |+
|
264
|
+
Set the log level to info.
|
265
|
+
DEPRECATED: use --log.level=quiet instead.
|
data/logstash-core.gemspec
CHANGED
@@ -14,12 +14,11 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.files = Dir.glob(["logstash-core.gemspec", "lib/**/*.rb", "spec/**/*.rb", "locales/*", "lib/logstash/api/init.ru"])
|
15
15
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
16
|
gem.name = "logstash-core"
|
17
|
-
gem.require_paths = ["lib"]
|
17
|
+
gem.require_paths = ["lib", "vendor/jars"]
|
18
18
|
gem.version = LOGSTASH_CORE_VERSION
|
19
19
|
|
20
|
-
gem.add_runtime_dependency "logstash-core-event-java", "5.0.0.alpha6.
|
20
|
+
gem.add_runtime_dependency "logstash-core-event-java", "5.0.0.alpha6.snapshot2"
|
21
21
|
|
22
|
-
gem.add_runtime_dependency "cabin", "~> 0.8.0" #(Apache 2.0 license)
|
23
22
|
gem.add_runtime_dependency "pry", "~> 0.10.1" #(Ruby license)
|
24
23
|
gem.add_runtime_dependency "stud", "~> 0.0.19" #(Apache 2.0 license)
|
25
24
|
gem.add_runtime_dependency "clamp", "~> 0.6.5" #(MIT license) for command line args/flags
|
@@ -59,4 +58,6 @@ Gem::Specification.new do |gem|
|
|
59
58
|
# https://github.com/rubinius/rubinius/issues/2632#issuecomment-26954565
|
60
59
|
gem.add_runtime_dependency "racc"
|
61
60
|
end
|
61
|
+
|
62
|
+
gem.add_runtime_dependency 'jar-dependencies', '~> 0.3.4'
|
62
63
|
end
|
@@ -6,7 +6,7 @@ describe LogStash::Api::RackApp do
|
|
6
6
|
|
7
7
|
class DummyApp
|
8
8
|
class RaisedError < StandardError; end
|
9
|
-
|
9
|
+
|
10
10
|
def call(env)
|
11
11
|
case env["PATH_INFO"]
|
12
12
|
when "/good-page"
|
@@ -21,7 +21,7 @@ describe LogStash::Api::RackApp do
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
let(:logger) {
|
24
|
+
let(:logger) { double("logger") }
|
25
25
|
|
26
26
|
describe LogStash::Api::RackApp::ApiErrorHandler do
|
27
27
|
let(:app) do
|
@@ -49,7 +49,7 @@ describe LogStash::Api::RackApp do
|
|
49
49
|
allow(logger).to receive(:error).with(any_args)
|
50
50
|
get "/raise-error"
|
51
51
|
end
|
52
|
-
|
52
|
+
|
53
53
|
it "should return a 500 error" do
|
54
54
|
expect(last_response.status).to eql(500)
|
55
55
|
end
|
@@ -74,13 +74,15 @@ describe LogStash::Api::RackApp do
|
|
74
74
|
run DummyApp.new
|
75
75
|
end
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
78
|
it "should log good requests as info" do
|
79
|
+
expect(logger).to receive(:info?).and_return(true)
|
79
80
|
expect(logger).to receive(:info).with(LogStash::Api::RackApp::ApiLogger::LOG_MESSAGE, anything).once
|
80
81
|
get "/good-page"
|
81
82
|
end
|
82
83
|
|
83
84
|
it "should log 5xx requests as warnings" do
|
85
|
+
expect(logger).to receive(:warn?).and_return(true)
|
84
86
|
expect(logger).to receive(:warn).with(LogStash::Api::RackApp::ApiLogger::LOG_MESSAGE, anything).once
|
85
87
|
get "/service-unavailable"
|
86
88
|
end
|
@@ -3,7 +3,9 @@ require "spec_helper"
|
|
3
3
|
require "logstash/config/loader"
|
4
4
|
|
5
5
|
describe LogStash::Config::Loader do
|
6
|
-
|
6
|
+
let(:logger) { double("logger") }
|
7
|
+
subject { described_class.new(logger) }
|
8
|
+
|
7
9
|
context "when local" do
|
8
10
|
before { expect(subject).to receive(:local_config).with(path) }
|
9
11
|
|
@@ -178,21 +178,15 @@ describe LogStash::Config::Mixin do
|
|
178
178
|
end
|
179
179
|
end
|
180
180
|
|
181
|
-
shared_examples("safe URI") do
|
181
|
+
shared_examples("safe URI") do |options|
|
182
|
+
options ||= {}
|
183
|
+
|
182
184
|
subject { klass.new("uri" => uri_str) }
|
183
185
|
|
184
186
|
it "should be a SafeURI object" do
|
185
187
|
expect(subject.uri).to(be_a(LogStash::Util::SafeURI))
|
186
188
|
end
|
187
189
|
|
188
|
-
it "should make password values hidden with #to_s" do
|
189
|
-
expect(subject.uri.to_s).to eql(uri_hidden)
|
190
|
-
end
|
191
|
-
|
192
|
-
it "should make password values hidden with #inspect" do
|
193
|
-
expect(subject.uri.inspect).to eql(uri_hidden)
|
194
|
-
end
|
195
|
-
|
196
190
|
it "should correctly copy URI types" do
|
197
191
|
clone = subject.class.new(subject.params)
|
198
192
|
expect(clone.uri.to_s).to eql(uri_hidden)
|
@@ -206,6 +200,18 @@ describe LogStash::Config::Mixin do
|
|
206
200
|
expect(subject.original_params['uri']).to(be_a(LogStash::Util::SafeURI))
|
207
201
|
end
|
208
202
|
|
203
|
+
if !options[:exclude_password_specs]
|
204
|
+
describe "passwords" do
|
205
|
+
it "should make password values hidden with #to_s" do
|
206
|
+
expect(subject.uri.to_s).to eql(uri_hidden)
|
207
|
+
end
|
208
|
+
|
209
|
+
it "should make password values hidden with #inspect" do
|
210
|
+
expect(subject.uri.inspect).to eql(uri_hidden)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
209
215
|
context "attributes" do
|
210
216
|
[:scheme, :user, :password, :hostname, :path].each do |attr|
|
211
217
|
it "should make #{attr} available" do
|
@@ -215,6 +221,19 @@ describe LogStash::Config::Mixin do
|
|
215
221
|
end
|
216
222
|
end
|
217
223
|
|
224
|
+
context "with a host:port combination" do
|
225
|
+
let(:scheme) { nil }
|
226
|
+
let(:user) { nil }
|
227
|
+
let(:password) { nil }
|
228
|
+
let(:hostname) { "myhostname" }
|
229
|
+
let(:port) { 1234 }
|
230
|
+
let(:path) { "" }
|
231
|
+
let(:uri_str) { "#{hostname}:#{port}" }
|
232
|
+
let(:uri_hidden) { "//#{hostname}:#{port}" }
|
233
|
+
|
234
|
+
include_examples("safe URI", :exclude_password_specs => true)
|
235
|
+
end
|
236
|
+
|
218
237
|
context "with a username / password" do
|
219
238
|
let(:scheme) { "myscheme" }
|
220
239
|
let(:user) { "myuser" }
|
@@ -6,8 +6,9 @@ describe LogStash::OutputDelegator do
|
|
6
6
|
let(:logger) { double("logger") }
|
7
7
|
let(:events) { 7.times.map { LogStash::Event.new }}
|
8
8
|
let(:plugin_args) { {"id" => "foo", "arg1" => "val1"} }
|
9
|
+
let(:metric) { LogStash::Instrument::NullMetric.new }
|
9
10
|
|
10
|
-
subject { described_class.new(logger, out_klass,
|
11
|
+
subject { described_class.new(logger, out_klass, metric, ::LogStash::OutputDelegatorStrategyRegistry.instance, plugin_args) }
|
11
12
|
|
12
13
|
context "with a plain output plugin" do
|
13
14
|
let(:out_klass) { double("output klass") }
|
@@ -15,10 +16,13 @@ describe LogStash::OutputDelegator do
|
|
15
16
|
let(:concurrency) { :single }
|
16
17
|
|
17
18
|
before(:each) do
|
19
|
+
# use the same metric instance
|
20
|
+
allow(metric).to receive(:namespace).with(any_args).and_return(metric)
|
21
|
+
|
18
22
|
allow(out_klass).to receive(:new).with(any_args).and_return(out_inst)
|
19
23
|
allow(out_klass).to receive(:name).and_return("example")
|
20
24
|
allow(out_klass).to receive(:concurrency).with(any_args).and_return concurrency
|
21
|
-
allow(out_klass).to receive(:config_name)
|
25
|
+
allow(out_klass).to receive(:config_name).and_return("dummy_plugin")
|
22
26
|
allow(out_inst).to receive(:register)
|
23
27
|
allow(out_inst).to receive(:multi_receive)
|
24
28
|
allow(out_inst).to receive(:metric=).with(any_args)
|
@@ -32,6 +36,11 @@ describe LogStash::OutputDelegator do
|
|
32
36
|
expect { subject }.not_to raise_error
|
33
37
|
end
|
34
38
|
|
39
|
+
it "should push the name of the plugin to the metric" do
|
40
|
+
expect(metric).to receive(:gauge).with(:name, out_klass.config_name)
|
41
|
+
described_class.new(logger, out_klass, metric, ::LogStash::OutputDelegatorStrategyRegistry.instance, plugin_args)
|
42
|
+
end
|
43
|
+
|
35
44
|
context "after having received a batch of events" do
|
36
45
|
before do
|
37
46
|
subject.register
|
@@ -88,6 +97,10 @@ describe LogStash::OutputDelegator do
|
|
88
97
|
expect(out_klass).to have_received(:new).with(plugin_args)
|
89
98
|
end
|
90
99
|
|
100
|
+
it "should set the metric on the instance" do
|
101
|
+
expect(out_inst).to have_received(:metric=).with(metric)
|
102
|
+
end
|
103
|
+
|
91
104
|
[[:register], [:do_close], [:multi_receive, [[]] ] ].each do |method, args|
|
92
105
|
context "strategy objects" do
|
93
106
|
before do
|
@@ -80,7 +80,7 @@ class DummySafeFilter < LogStash::Filters::Base
|
|
80
80
|
end
|
81
81
|
|
82
82
|
class TestPipeline < LogStash::Pipeline
|
83
|
-
attr_reader :outputs, :settings
|
83
|
+
attr_reader :outputs, :settings
|
84
84
|
end
|
85
85
|
|
86
86
|
describe LogStash::Pipeline do
|
@@ -130,7 +130,7 @@ describe LogStash::Pipeline do
|
|
130
130
|
let(:logger) { double("pipeline logger").as_null_object }
|
131
131
|
|
132
132
|
before do
|
133
|
-
expect(
|
133
|
+
expect(TestPipeline).to receive(:logger).and_return(logger)
|
134
134
|
allow(logger).to receive(:debug?).and_return(true)
|
135
135
|
end
|
136
136
|
|
@@ -641,6 +641,18 @@ describe LogStash::Pipeline do
|
|
641
641
|
plugin_name = dummy_output_id.to_sym
|
642
642
|
expect(collected_metric[:stats][:pipelines][:main][:plugins][:outputs][plugin_name][:events][:out].value).to eq(number_of_events)
|
643
643
|
end
|
644
|
+
|
645
|
+
it "populates the name of the output plugin" do
|
646
|
+
plugin_name = dummy_output_id.to_sym
|
647
|
+
expect(collected_metric[:stats][:pipelines][:main][:plugins][:outputs][plugin_name][:name].value).to eq(DummyOutput.config_name)
|
648
|
+
end
|
649
|
+
|
650
|
+
it "populates the name of the filter plugin" do
|
651
|
+
[multiline_id, multiline_id_other].map(&:to_sym).each do |id|
|
652
|
+
plugin_name = "multiline_#{id}".to_sym
|
653
|
+
expect(collected_metric[:stats][:pipelines][:main][:plugins][:filters][plugin_name][:name].value).to eq(LogStash::Filters::Multiline.config_name)
|
654
|
+
end
|
655
|
+
end
|
644
656
|
end
|
645
657
|
end
|
646
658
|
|
@@ -76,7 +76,7 @@ describe LogStash::Plugin do
|
|
76
76
|
.with(plugin_name)
|
77
77
|
.and_return(double(:version => Gem::Version.new('1.0.0')))
|
78
78
|
|
79
|
-
expect_any_instance_of(
|
79
|
+
expect_any_instance_of(LogStash::Logging::Logger).not_to receive(:info)
|
80
80
|
subject.validate({})
|
81
81
|
end
|
82
82
|
|
@@ -85,7 +85,7 @@ describe LogStash::Plugin do
|
|
85
85
|
.with(plugin_name)
|
86
86
|
.and_return(double(:version => Gem::Version.new('0.9.1')))
|
87
87
|
|
88
|
-
expect_any_instance_of(
|
88
|
+
expect_any_instance_of(LogStash::Logging::Logger).to receive(:info)
|
89
89
|
.with(/Using version 0.9.x/)
|
90
90
|
|
91
91
|
subject.validate({})
|
@@ -96,7 +96,7 @@ describe LogStash::Plugin do
|
|
96
96
|
.with(plugin_name)
|
97
97
|
.and_return(double(:version => Gem::Version.new('0.1.1')))
|
98
98
|
|
99
|
-
expect_any_instance_of(
|
99
|
+
expect_any_instance_of(LogStash::Logging::Logger).to receive(:info)
|
100
100
|
.with(/Using version 0.1.x/)
|
101
101
|
subject.validate({})
|
102
102
|
end
|
@@ -110,7 +110,7 @@ describe LogStash::Plugin do
|
|
110
110
|
.with(plugin_name)
|
111
111
|
.and_return(double(:version => Gem::Version.new('0.1.1')))
|
112
112
|
|
113
|
-
expect_any_instance_of(
|
113
|
+
expect_any_instance_of(LogStash::Logging::Logger).to receive(:info)
|
114
114
|
.once
|
115
115
|
.with(/Using version 0.1.x/)
|
116
116
|
|
@@ -119,7 +119,7 @@ describe LogStash::Plugin do
|
|
119
119
|
end
|
120
120
|
|
121
121
|
it "warns the user if we can't find a defined version" do
|
122
|
-
expect_any_instance_of(
|
122
|
+
expect_any_instance_of(LogStash::Logging::Logger).to receive(:warn)
|
123
123
|
.once
|
124
124
|
.with(/plugin doesn't have a version/)
|
125
125
|
|
@@ -128,7 +128,7 @@ describe LogStash::Plugin do
|
|
128
128
|
|
129
129
|
|
130
130
|
it 'logs a warning if the plugin use the milestone option' do
|
131
|
-
expect_any_instance_of(
|
131
|
+
expect_any_instance_of(LogStash::Logging::Logger).to receive(:debug)
|
132
132
|
.with(/stromae plugin is using the 'milestone' method/)
|
133
133
|
|
134
134
|
class LogStash::Filters::Stromae < LogStash::Filters::Base
|
@@ -278,6 +278,7 @@ describe LogStash::Plugin do
|
|
278
278
|
[LogStash::Inputs::Base, LogStash::Filters::Base, LogStash::Outputs::Base].each do |base|
|
279
279
|
let(:plugin) do
|
280
280
|
Class.new(base) do
|
281
|
+
#include LogStash::Util::Loggable
|
281
282
|
config_name "testing"
|
282
283
|
|
283
284
|
def register
|