diff --git a/lib/fluent/engine.rb b/lib/fluent/engine.rb index 6074a54592..184cb328d1 100644 --- a/lib/fluent/engine.rb +++ b/lib/fluent/engine.rb @@ -79,38 +79,27 @@ def parse_config(io, fname, basepath = Dir.pwd, v1_config = false) def run_configure(conf) configure(conf) - conf.check_not_fetched { |key, e| + conf.check_not_fetched do |key, e| parent_name, plugin_name = e.unused_in - if parent_name - message = if plugin_name - "section <#{e.name}> is not used in <#{parent_name}> of #{plugin_name} plugin" - else - "section <#{e.name}> is not used in <#{parent_name}>" - end - - if @dry_run_mode && @supervisor_mode - $log.warn :supervisor, message - elsif e.for_every_workers? - $log.warn :worker0, message - elsif e.for_this_worker? - $log.warn message - end - next + message = if parent_name && plugin_name + "section <#{e.name}> is not used in <#{parent_name}> of #{plugin_name} plugin" + elsif parent_name + "section <#{e.name}> is not used in <#{parent_name}>" + elsif e.name != 'system' && !(@without_source && e.name == 'source') + "parameter '#{key}' in #{e.to_s.strip} is not used." + else + nil + end + next if message.nil? + + if @dry_run_mode && @supervisor_mode + $log.warn :supervisor, message + elsif e.for_every_workers? + $log.warn :worker0, message + elsif e.for_this_worker? + $log.warn message end - - unless e.name == 'system' - unless @without_source && e.name == 'source' - message = "parameter '#{key}' in #{e.to_s.strip} is not used." - if @dry_run_mode && @supervisor_mode - $log.warn :supervisor, message - elsif e.for_every_workers? - $log.warn :worker0, message - elsif e.for_this_worker? - $log.warn message - end - end - end - } + end end def configure(conf)