devdocs/lib/docs/subscribers/request_subscriber.rb
2017-07-02 19:26:00 -04:00

11 lines
274 B
Ruby

# frozen_string_literal: true
module Docs
class RequestSubscriber < Subscriber
self.namespace = 'request'
def response(event)
log "Request: #{format_url event.payload[:url]} [#{event.payload[:response].code}] [#{event.duration.round}ms]"
end
end
end