Module: Fluent::SystemConfig::Mixin

Included in:
FileOutput, Plugin::Base, Plugin::Buffer::FileChunk, Plugin::FileBuffer
Defined in:
lib/fluent/system_config.rb

Instance Method Summary collapse

Instance Method Details

#system_configObject



102
103
104
105
106
107
108
109
# File 'lib/fluent/system_config.rb', line 102

def system_config
  require 'fluent/engine'
  unless defined?($_system_config)
    $_system_config = nil
  end
  (instance_variable_defined?("@_system_config") && @_system_config) ||
    $_system_config || Fluent::Engine.system_config
end

#system_config_override(opts = {}) ⇒ Object



111
112
113
114
115
116
117
118
119
# File 'lib/fluent/system_config.rb', line 111

def system_config_override(opts={})
  require 'fluent/engine'
  if !instance_variable_defined?("@_system_config") || @_system_config.nil?
    @_system_config = (defined?($_system_config) && $_system_config ? $_system_config : Fluent::Engine.system_config).dup
  end
  opts.each_pair do |key, value|
    @_system_config.send(:"#{key.to_s}=", value)
  end
end