Closed agrberg closed 3 years ago
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.
Popped that in https://github.com/dblock/iex-ruby-client/pull/88. Let me know what you think 👍
Enable passing of logger configuration hash to Faraday for finer logger control.
[closes #86]