mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
remove setting quiet requests inside puma rack handler (#2075)
* remove setting quiet requests inside puma rack handler * added test cases for user and file config of log_requests * update test cases to use example files Co-authored-by: Nate Berkopec <nate.berkopec@gmail.com>
This commit is contained in:
parent
8c9b3ebc7a
commit
5b8f557714
3 changed files with 30 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
||||||
* Features
|
* Features
|
||||||
* Add pumactl `thread-backtraces` command to print thread backtraces (#2053)
|
* Add pumactl `thread-backtraces` command to print thread backtraces (#2053)
|
||||||
* Configuration: `environment` is read from `RAILS_ENV`, if `RACK_ENV` can't be found (#2022)
|
* Configuration: `environment` is read from `RAILS_ENV`, if `RACK_ENV` can't be found (#2022)
|
||||||
|
* Do not set user_config to quiet by default to allow for file config (#2074)
|
||||||
* `Puma.stats` now returns a Hash instead of a JSON string (#2086)
|
* `Puma.stats` now returns a Hash instead of a JSON string (#2086)
|
||||||
* `GC.compact` is called before fork if available (#2093)
|
* `GC.compact` is called before fork if available (#2093)
|
||||||
* Add `requests_count` to workers stats. (#2106)
|
* Add `requests_count` to workers stats. (#2106)
|
||||||
|
|
|
@ -30,8 +30,6 @@ module Rack
|
||||||
end
|
end
|
||||||
|
|
||||||
conf = ::Puma::Configuration.new(options, default_options) do |user_config, file_config, default_config|
|
conf = ::Puma::Configuration.new(options, default_options) do |user_config, file_config, default_config|
|
||||||
user_config.quiet
|
|
||||||
|
|
||||||
if options.delete(:Verbose)
|
if options.delete(:Verbose)
|
||||||
app = Rack::CommonLogger.new(app, STDOUT)
|
app = Rack::CommonLogger.new(app, STDOUT)
|
||||||
end
|
end
|
||||||
|
|
|
@ -226,4 +226,33 @@ class TestUserSuppliedOptionsIsNotPresent < Minitest::Test
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_file_log_requests_wins_over_default_config
|
||||||
|
file_log_requests_config = true
|
||||||
|
|
||||||
|
@options[:config_files] = [
|
||||||
|
'test/shell/t1_conf.rb'
|
||||||
|
]
|
||||||
|
|
||||||
|
conf = Rack::Handler::Puma.config(->{}, @options)
|
||||||
|
conf.load
|
||||||
|
|
||||||
|
assert_equal file_log_requests_config, conf.options[:log_requests]
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def test_user_log_requests_wins_over_file_config
|
||||||
|
file_log_requests_config = true
|
||||||
|
user_log_requests_config = false
|
||||||
|
|
||||||
|
@options[:log_requests] = user_log_requests_config
|
||||||
|
@options[:config_files] = [
|
||||||
|
'test/shell/t1_conf.rb'
|
||||||
|
]
|
||||||
|
|
||||||
|
conf = Rack::Handler::Puma.config(->{}, @options)
|
||||||
|
conf.load
|
||||||
|
|
||||||
|
assert_equal user_log_requests_config, conf.options[:log_requests]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue