mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Don't log requests by default. Fixes #852
This commit is contained in:
parent
20e99d1c04
commit
03ed48ca90
4 changed files with 18 additions and 6 deletions
|
@ -147,10 +147,14 @@ module Puma
|
|||
c.prune_bundler
|
||||
end
|
||||
|
||||
o.on "-q", "--quiet", "Quiet down the output" do
|
||||
o.on "-q", "--quiet", "Do not log requests internally (default true)" do
|
||||
c.quiet
|
||||
end
|
||||
|
||||
o.on "-v", "--log-requests", "Log requests as they occur" do
|
||||
c.log_requests
|
||||
end
|
||||
|
||||
o.on "-R", "--restart-cmd CMD",
|
||||
"The puma command to run during a hot restart",
|
||||
"Default: inferred" do |cmd|
|
||||
|
|
|
@ -165,7 +165,7 @@ module Puma
|
|||
{
|
||||
:min_threads => 0,
|
||||
:max_threads => 16,
|
||||
:quiet => false,
|
||||
:log_requests => false,
|
||||
:debug => false,
|
||||
:binds => ["tcp://#{DefaultTCPHost}:#{DefaultTCPPort}"],
|
||||
:workers => 0,
|
||||
|
@ -242,10 +242,10 @@ module Puma
|
|||
require 'puma/tcp_logger'
|
||||
|
||||
logger = @options[:logger]
|
||||
return TCPLogger.new(logger, found, @options[:quiet])
|
||||
return TCPLogger.new(logger, found, @options[:log_requests])
|
||||
end
|
||||
|
||||
if !@options[:quiet] and @options[:environment] == "development"
|
||||
if @options[:log_requests]
|
||||
logger = @options[:logger]
|
||||
found = CommonLogger.new(found, logger)
|
||||
end
|
||||
|
|
|
@ -160,8 +160,14 @@ module Puma
|
|||
|
||||
# Disable request logging.
|
||||
#
|
||||
def quiet
|
||||
@options[:quiet] = true
|
||||
def quiet(which=true)
|
||||
@options[:log_requests] = !which
|
||||
end
|
||||
|
||||
# Enable request logging
|
||||
#
|
||||
def log_requests(which=true)
|
||||
@options[:log_requests] = which
|
||||
end
|
||||
|
||||
# Show debugging info
|
||||
|
|
|
@ -13,6 +13,8 @@ module Rack
|
|||
options = DEFAULT_OPTIONS.merge(options)
|
||||
|
||||
conf = ::Puma::Configuration.new do |c|
|
||||
c.quiet
|
||||
|
||||
if options.delete(:Verbose)
|
||||
app = Rack::CommonLogger.new(app, STDOUT)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue