mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
default quiet specs
This commit is contained in:
parent
c9377e9572
commit
41313c3946
1 changed files with 10 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
require "insist"
|
require "insist"
|
||||||
require "logstash/agent"
|
require "logstash/agent"
|
||||||
require "logstash/event"
|
require "logstash/event"
|
||||||
|
require "logstash/logging"
|
||||||
require "insist"
|
require "insist"
|
||||||
require "stud/try"
|
require "stud/try"
|
||||||
|
|
||||||
|
@ -13,9 +14,11 @@ if RUBY_VERSION < "1.9.2"
|
||||||
raise LoadError
|
raise LoadError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
$logger = LogStash::Logger.new(STDOUT)
|
||||||
if ENV["TEST_DEBUG"]
|
if ENV["TEST_DEBUG"]
|
||||||
Cabin::Channel.get.level = :debug
|
$logger.level = :debug
|
||||||
Cabin::Channel.get.subscribe(STDOUT)
|
else
|
||||||
|
$logger.level = :error
|
||||||
end
|
end
|
||||||
|
|
||||||
module LogStash
|
module LogStash
|
||||||
|
@ -43,9 +46,11 @@ module LogStash
|
||||||
default_tags = @default_tags || []
|
default_tags = @default_tags || []
|
||||||
config = get_config
|
config = get_config
|
||||||
agent = LogStash::Agent.new
|
agent = LogStash::Agent.new
|
||||||
|
agent.instance_eval { parse_options(["--quiet"]) }
|
||||||
@inputs, @filters, @outputs = agent.instance_eval { parse_config(config) }
|
@inputs, @filters, @outputs = agent.instance_eval { parse_config(config) }
|
||||||
[@inputs, @filters, @outputs].flatten.each do |plugin|
|
[@inputs, @filters, @outputs].flatten.each do |plugin|
|
||||||
plugin.logger = Cabin::Channel.get
|
plugin.logger = $logger
|
||||||
|
plugin.logger.level = :error
|
||||||
plugin.register
|
plugin.register
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -107,6 +112,7 @@ module LogStash
|
||||||
def input(&block)
|
def input(&block)
|
||||||
config = get_config
|
config = get_config
|
||||||
agent = LogStash::Agent.new
|
agent = LogStash::Agent.new
|
||||||
|
agent.instance_eval { parse_options(["--quiet"]) }
|
||||||
it "looks good" do
|
it "looks good" do
|
||||||
inputs, filters, outputs = agent.instance_eval { parse_config(config) }
|
inputs, filters, outputs = agent.instance_eval { parse_config(config) }
|
||||||
block.call(inputs)
|
block.call(inputs)
|
||||||
|
@ -133,7 +139,7 @@ module LogStash
|
||||||
before :each do
|
before :each do
|
||||||
start = ::Time.now
|
start = ::Time.now
|
||||||
@agent = LogStash::Agent.new
|
@agent = LogStash::Agent.new
|
||||||
@agent.run(["-e", config_str])
|
@agent.run(["--quiet", "-e", config_str])
|
||||||
@agent.wait
|
@agent.wait
|
||||||
@duration = ::Time.now - start
|
@duration = ::Time.now - start
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue