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
1 changed files with 1 additions and 1 deletions

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|