Class: Crystal::Processors::HTTPLogger
- Inherits:
-
Crystal::Processor
- Object
- Crystal::Processor
- Crystal::Processors::HTTPLogger
- Defined in:
- lib/crystal/http/processors/http_logger.rb
Instance Attribute Summary
Attributes inherited from Crystal::Processor
Instance Method Summary collapse
Methods inherited from Crystal::Processor
Constructor Details
This class inherits a constructor from Crystal::Processor
Instance Method Details
#call ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/crystal/http/processors/http_logger.rb', line 4 def call if workspace.request? and workspace.params? method, path, ip, time, format = workspace.request.request_method, workspace.path, workspace.request.ip, (workspace.start_time || Time.now), workspace.params.format logger.info "Started '#{path}' as '#{format}' (for #{ip} at #{time.to_s} with #{method})" end next_processor.call end |