Class: EmmyHttp::Client::Monitor
- Inherits:
-
Object
- Object
- EmmyHttp::Client::Monitor
- Defined in:
- lib/emmy_http/client/monitor.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/emmy_http/client/monitor.rb', line 5 def logger @logger end |
Instance Method Details
#bind(op) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/emmy_http/client/monitor.rb', line 7 def bind(op) @operation = op # operation events op.on :init do logger.debug "connected" end op.on :head do logger.debug "headers received" end op.on :success do |response, operation, conn| logger.info("request success with status #{response.status}") end op.on :error do || logger.error() end # client events op.adapter.client.on :change do |state, client| logger.debug "change state to #{state}" end end |