mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
parent
6626fa897c
commit
58ccca7028
4 changed files with 6 additions and 5 deletions
|
@ -121,10 +121,8 @@ class LogStash::Plugin
|
|||
# This is keep for backward compatibility, the logic was moved into the registry class
|
||||
# but some plugins use this method to return a specific instance on lookup
|
||||
#
|
||||
#
|
||||
#
|
||||
# Should I remove this now and make sure the pipeline invoke the Registry or I should wait for 6.0
|
||||
# Its not really part of the public api but its used by the tests.
|
||||
# Its not really part of the public api but its used by the tests a lot to mock the plugins.
|
||||
def self.lookup(type, name)
|
||||
LogStash::PluginRegistry.lookup_pipeline_plugin(type, name)
|
||||
end
|
||||
|
|
|
@ -137,7 +137,7 @@ module LogStash module Plugins
|
|||
if plugin.nil?
|
||||
begin
|
||||
path = "logstash/#{type}s/#{plugin_name}"
|
||||
require path
|
||||
require path rescue LoadError # Plugin might be already defined in the current scope
|
||||
klass = namespace_lookup(type, plugin_name)
|
||||
plugin = lazy_add(type, plugin_name, klass)
|
||||
rescue => e
|
||||
|
@ -170,7 +170,7 @@ module LogStash module Plugins
|
|||
end
|
||||
|
||||
def lazy_add(type, name, klass)
|
||||
logger.error("Lazy Adding plugin to the registry", :name => name, :type => type, :class => klass)
|
||||
logger.error("On demand adding plugin to the registry", :name => name, :type => type, :class => klass)
|
||||
add_plugin(type, name, klass)
|
||||
end
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ require "stud/task"
|
|||
require "logstash/devutils/rspec/spec_helper"
|
||||
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
|
||||
require "lib/api/support/resource_dsl_methods"
|
||||
require_relative "../support/mocks_classes"
|
||||
require 'rspec/expectations'
|
||||
require "logstash/settings"
|
||||
require 'rack/test'
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
require "logstash/outputs/base"
|
||||
require "thread"
|
||||
|
||||
module LogStash module Outputs
|
||||
class DummyOutput < LogStash::Outputs::Base
|
||||
config_name "dummyoutput"
|
||||
milestone 2
|
||||
|
@ -47,3 +48,4 @@ class DummyOutputWithEventsArray < LogStash::Outputs::Base
|
|||
def close
|
||||
end
|
||||
end
|
||||
end end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue