Skip to content

Comments

Add instrumentation#7

Merged
rauchy merged 3 commits intorauchy:masterfrom
orgoldfus:add-instrumentation
Dec 1, 2016
Merged

Add instrumentation#7
rauchy merged 3 commits intorauchy:masterfrom
orgoldfus:add-instrumentation

Conversation

@orgoldfus
Copy link

Add instrumentation in order to enable logging

module Ringcaptcha
module APIStub
def self.call(api_key, app_key, path, params = {})
if Ringcaptcha.use_instrumentation
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like asking instead of telling. Also this method eventually calls call_ringcaptcha, and the conditional here makes it feel like it does 2 separate things according to the value of use_instrumentation. It doesn't.

How about instead you call a block, something like

with_instrumentation do
  call_ringcaptcha(api_key, app_key, path, params = {})
end

with_instrumentation will either instrument the block (if required), or simply yield it. WDYT?

@orgoldfus
Copy link
Author

Changed. WDYT?

@orgoldfus
Copy link
Author

True :/

@rauchy rauchy merged commit 8251c60 into rauchy:master Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants