Sha256: f84da7cede6e69ffe89f940b90a25cf9e3da373f06f3f31eeb9bd87f4b56a3e1

Contents?: true

Size: 507 Bytes

Versions: 3

Compression:

Stored size: 507 Bytes

Contents

module Crystal
  module Processors
    class HTTPLogger < Processor
      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
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
crystal-0.0.13 lib/crystal/http/processors/http_logger.rb
crystal-0.0.12 lib/crystal/http/processors/http_logger.rb
crystal_ext-0.0.11 lib/crystal/http/processors/http_logger.rb