Enable the logging of the request body#374
Conversation
Here's an example of a CHANGELOG.md entry: * [#374](https://github.com/slack-ruby/slack-ruby-client/pull/374): Enable the logging of the request body - [@ts-3156](https://github.com/ts-3156).Generated by 🚫 Danger |
|
I think we don't want this by default. Did you figure out a way to do this in your own code? I would like us to document how to do this without changing the default configuration, in README. |
|
@dblock Thank you for taking the time to reply.
I have the same opinion. However, I have not come up with a suitable code to pass a value for
Yes. I found this option when I investigated strange behavior that Slack doesn't display the image preview correctly.
If you need this option for logging, I will write how to do it in README. However, in order to use this option, I need to modify not just the documentation, but also the code. Is this really what you want? You don't need to hurry. It is OK if this idea is discarded. |
|
How about introducing If you feel more ambitious, take a look at https://lostisland.github.io/faraday/middleware/logger. It also supports blocks and filtering which we could expose. The https://github.com/ashkan18/graphlient gem does it like so: Graphlient::Client.new('http://test-graphql.biz/graphql') do |client|
client.http do |h|
h.connection do |c|
c.adapter Faraday::Adapter::Rack, app
end
end
endSo Slack.configure do |config|
config.connection do |conn|
conn.response :logger, logger, { bodies: true }
end
end
end |
1963b52 to
097b3ca
Compare
When debugging, I sometimes want to see the request body. I don't know if other people feel the same way. If you don't need it, please feel free to close this pull request.