Class: Puma::TCPLogger
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/puma/tcp_logger.rb |
Constant Summary
-
FORMAT =
# File 'lib/puma/tcp_logger.rb', line 11"%s - %s"
Class Method Summary
- .new(logger, app, quiet = false) ⇒ TCPLogger constructor
Instance Method Summary
Constructor Details
.new(logger, app, quiet = false) ⇒ TCPLogger
# File 'lib/puma/tcp_logger.rb', line 5
def initialize(logger, app, quiet=false) @logger = logger @app = app @quiet = quiet end
Instance Method Details
#call(env, socket)
[ GitHub ]# File 'lib/puma/tcp_logger.rb', line 26
def call(env, socket) who = env[Const::REMOTE_ADDR] log who, "connected" unless @quiet env['log'] = lambda { |str| log(who, str) } begin @app.call env, socket rescue Object => e log who, "exception: #{e.} (#{e.class})" else log who, "disconnected" unless @quiet end end