1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Merge pull request #1257 from namusyaka/fix-1142

avoid logging to stderr when loading config files
This commit is contained in:
Zachary Scott 2017-03-05 01:49:43 +09:00 committed by GitHub
commit a97dc36dc0

View file

@ -129,7 +129,7 @@ module Sinatra
paths.each do |pattern|
Dir.glob(pattern) do |file|
raise UnsupportedConfigType unless ['.yml', '.erb'].include?(File.extname(file))
$stderr.puts "loading config file '#{file}'" if logging?
logger.info "loading config file '#{file}'" if logging? && respond_to?(:logger)
document = ERB.new(IO.read(file)).result
yaml = config_for_env(YAML.load(document)) || {}
yaml.each_pair do |key, value|