def warn_missing_config_file(path)
based_on = 'unknown'
source = ::NewRelic::Agent.config.source(:config_path)
candidate_paths = [path]
case source
when DefaultSource
based_on = 'defaults'
candidate_paths = NewRelic::Agent.config[:config_search_paths].map do |p|
File.expand_path(p)
end
when EnvironmentSource
based_on = 'environment variable'
when ManualSource
based_on = 'API call'
end
NewRelic::Agent.logger.warn(
"No configuration file found. Working directory = #{Dir.pwd}",
"Looked in these locations (based on #{based_on}): #{candidate_paths.join(", ")}"
)
end