mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- log the compiled code more readably
- clarify rbx issues indicating that I haven't really done any debugging to figure out where the problem is. - update changelog with todos - remove unused require - try to fix up require() debugger
This commit is contained in:
parent
d39e64f60b
commit
af538da782
6 changed files with 22 additions and 23 deletions
|
@ -4,14 +4,16 @@
|
|||
TODO(sissel): Document what this means, etc.
|
||||
- The old logstash web ui has been replaced by Kibana 3. Kibana is a far
|
||||
superior search and analytics interface.
|
||||
- TODO(sissel): document new conditionals feature (LOGSTASH-661)
|
||||
- TODO(sissel): document new field selection syntax (LOGSTASH-1153)
|
||||
- ElasticSearch version 0.90.0 is included.
|
||||
- The multiline filter is replaced by the multiline codec.
|
||||
- Many deprecated features have been removed.
|
||||
TODO(sissel): Document what these were.
|
||||
- 'type' is no longer a required setting on inputs.
|
||||
- feature: codecs. Used to implement encoding/decoding of events
|
||||
for input and output plugins.
|
||||
TODO(nickethier): Document how to use and how to hack.
|
||||
- The multiline filter is replaced by the multiline codec.
|
||||
|
||||
## inputs
|
||||
- bugfix: gelf: work around gelf parser errors (#476, patch by Chris McCoy)
|
||||
|
|
|
@ -5,7 +5,6 @@ require "logstash/logging"
|
|||
require "logstash/util/password"
|
||||
require "logstash/version"
|
||||
require "i18n"
|
||||
require "pathname"
|
||||
|
||||
# This module is meant as a mixin to classes wishing to be configurable from
|
||||
# config files
|
||||
|
|
|
@ -4,7 +4,13 @@ if $DEBUGLIST.include?("require")
|
|||
|
||||
def require(path)
|
||||
result = require_debug(path)
|
||||
puts "require(\"#{path}\") => #{result} (from: #{caller[1]})"
|
||||
origin = caller[1]
|
||||
if origin =~ /rubygems\/custom_require/
|
||||
origin = caller[3]
|
||||
end
|
||||
puts "require(\"#{path}\")" if result
|
||||
#puts "require(\"#{path}\") => #{result} (from: #{origin})"
|
||||
#puts caller.map { |c| " => #{c}" }.join("\n")
|
||||
end
|
||||
|
||||
alias_method :load_debug, :load
|
||||
|
|
|
@ -21,7 +21,7 @@ class LogStash::Pipeline
|
|||
code = @config.compile
|
||||
# The config code is hard to represent as a log message...
|
||||
# So just print it.
|
||||
@logger.debug? && @logger.debug("Compiled pipeline code", :code => code)
|
||||
@logger.debug? && @logger.debug("Compiled pipeline code:\n#{code}")
|
||||
eval(code)
|
||||
|
||||
@input_to_filter = SizedQueue.new(20)
|
||||
|
@ -82,9 +82,10 @@ class LogStash::Pipeline
|
|||
def wait_inputs
|
||||
@input_threads.each(&:join)
|
||||
rescue Interrupt
|
||||
# rbx doesn't do SIGINT handling very well, so we catch Interrupt here and
|
||||
# signal a shutdown. For some reason the signal handler isn't invoked it
|
||||
# seems? I dunno, haven't looked much into it.
|
||||
# rbx does weird things during do SIGINT that I haven't debugged
|
||||
# so we catch Interrupt here and signal a shutdown. For some reason the
|
||||
# signal handler isn't invoked it seems? I dunno, haven't looked much into
|
||||
# it.
|
||||
shutdown
|
||||
end
|
||||
|
||||
|
|
|
@ -1,24 +1,12 @@
|
|||
require "logstash/namespace"
|
||||
|
||||
module LogStash::Util
|
||||
PR_SET_NAME = 15
|
||||
|
||||
UNAME = case RbConfig::CONFIG["host_os"]
|
||||
when /^linux/; "linux"
|
||||
else; RbConfig::CONFIG["host_os"]
|
||||
end
|
||||
|
||||
module LibC
|
||||
if UNAME == "linux"
|
||||
require "ffi"
|
||||
extend FFI::Library
|
||||
ffi_lib 'c'
|
||||
|
||||
# Ok so the 2nd arg isn't really a string... but whaatever
|
||||
attach_function :prctl, [:int, :string, :long, :long, :long], :int
|
||||
end
|
||||
end
|
||||
|
||||
PR_SET_NAME = 15
|
||||
def self.set_thread_name(name)
|
||||
if RUBY_ENGINE == "jruby"
|
||||
# Keep java and ruby thread names in sync.
|
||||
|
@ -27,6 +15,7 @@ module LogStash::Util
|
|||
Thread.current[:name] = name
|
||||
|
||||
if UNAME == "linux"
|
||||
require "logstash/util/prctl"
|
||||
# prctl PR_SET_NAME allows up to 16 bytes for a process name
|
||||
# since MRI 1.9, JRuby, and Rubinius use system threads for this.
|
||||
LibC.prctl(PR_SET_NAME, name[0..16], 0, 0, 0)
|
||||
|
|
|
@ -79,9 +79,11 @@ module LogStash
|
|||
it "inputs" do
|
||||
queue = Queue.new
|
||||
pipeline = LogStash::Pipeline.new(config_str)
|
||||
(class << pipeline; self; end).send(:define_method, :output) do |event|
|
||||
queue << event
|
||||
end
|
||||
#(class << pipeline; self; end).send(:define_method, :output) do |event|
|
||||
#p :event => event
|
||||
#queue << event
|
||||
#end
|
||||
#p pipeline.method(:output)
|
||||
block.call(pipeline, queue)
|
||||
pipeline.shutdown
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue