Module: LogStash::Util::Require

Defined in:
lib/logstash/util/require-helper.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject

Returns the value of attribute logger.



7
8
9
# File 'lib/logstash/util/require-helper.rb', line 7

def logger
  @logger
end

Class Method Details

.require(lib, gemdep, message = nil) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/logstash/util/require-helper.rb', line 9

def require(lib, gemdep, message=nil)
  @logger ||= LogStash::Logger.new(STDERR)
  begin
    require lib
  rescue LoadError => e
    @logger.error("Failed loading '#{lib}'")
  end
end