Class: Fluent::Supervisor

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/format/check.rb

Instance Method Summary collapse

Instance Method Details

#extended_dry_runObject

Extended to accept IO object

Returns:

  • true if success

Raises:

  • Fluent::ConfigParseError if conf has syntax errors

  • Fluent::ConfigError if plugin raises config error



97
98
99
100
101
102
103
104
# File 'lib/fluent/format/check.rb', line 97

def extended_dry_run
  extended_read_config
  change_privilege
  init_engine
  install_main_process_signal_handlers
  run_configure
  true
end

#extended_read_configObject

Extended to accept IO object



107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/fluent/format/check.rb', line 107

def extended_read_config
  if @config_path.respond_to?(:read) # IO object
    @config_data = @config_path.read
  else
    @config_fname = File.basename(@config_path)
    @config_basedir = File.dirname(@config_path)
    @config_data = File.read(@config_path)
  end
  if @inline_config == '-'
    @config_data << "\n" << STDIN.read
  elsif @inline_config
    @config_data << "\n" << @inline_config.gsub("\\n","\n")
  end
end