Sha256: 47d34abf6bd1054c59ab0f5b7522f4ac1ad68b4a735b4d4980427b05a9941caa

Contents?: true

Size: 384 Bytes

Versions: 20

Compression:

Stored size: 384 Bytes

Contents

#!/usr/bin/env falcon --verbose serve -c

require 'async'

class RequestLogger
	def initialize(app)
		@app = app
	end
	
	def call(env)
		logger = Async.logger.with(level: :debug, name: "middleware")
		
		Async(logger: logger) do
			@app.call(env)
		end.wait
	end
end

use RequestLogger

run lambda {|env| Async.logger.debug(self) {env['HTTP_USER_AGENT']}; [200, {}, ["Hello World"]]}

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
falcon-0.34.5 examples/hello/config.ru
falcon-0.34.4 examples/hello/config.ru
falcon-0.34.3 examples/hello/config.ru
falcon-0.34.2 examples/hello/config.ru
falcon-0.34.1 examples/hello/config.ru
falcon-0.34.0 examples/hello/config.ru
falcon-0.33.11 examples/hello/config.ru
falcon-0.33.10 examples/hello/config.ru
falcon-0.33.9 examples/hello/config.ru
falcon-0.33.8 examples/hello/config.ru
falcon-0.33.7 examples/hello/config.ru
falcon-0.33.6 examples/hello/config.ru
falcon-0.33.5 examples/hello/config.ru
falcon-0.33.4 examples/hello/config.ru
falcon-0.33.3 examples/hello/config.ru
falcon-0.33.2 examples/hello/config.ru
falcon-0.33.1 examples/hello/config.ru
falcon-0.33.0 examples/hello/config.ru
falcon-0.32.1 examples/hello/config.ru
falcon-0.32.0 examples/hello/config.ru