Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Faraday logger configuration #87

Merged
merged 1 commit into from
Oct 26, 2020

Conversation

agrberg
Copy link
Collaborator

@agrberg agrberg commented Oct 25, 2020

Enable passing of logger configuration hash to Faraday for finer logger control.

[closes #86]

@agrberg agrberg mentioned this pull request Oct 25, 2020
@dblock dblock merged commit 9613dcd into dblock:master Oct 26, 2020
@dblock
Copy link
Owner

dblock commented Oct 26, 2020

This is good, i merged it.

I was wondering whether it would be valuable to write something like this:

IEX::Api::Client.configure do |config|
  config.logger.instance = Logger.new(STDOUT)
  config.logger.options = { bodies: true }
  config.logger.proc = proc { ... }
end

or

IEX::Api::Client.configure do |config|
  config.logger do |logger|
    logger.instance = Logger.new(STDOUT)
    logger.options = { bodies: true }
    logger.proc = proc { ... }
  end
end

If you're bored make a LoggerConfig class that behaves like Config, and it should allow this kind of behavior, avoiding having to do the whole is_a?(Hash) in the implementation, too.

@agrberg agrberg deleted the advanced_logging branch October 26, 2020 13:45
@agrberg
Copy link
Collaborator Author

agrberg commented Oct 26, 2020

Popped that in #88. Let me know what you think 👍

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.

Support logging filtering
2 participants