chulkilee / ex_force

A Salesforce REST API wrapper for Elixir
https://hex.pm/packages/ex_force
MIT License
38 stars 27 forks source link

Is it possible to add `Tesla.Middleware.Logger` to my requests? #73

Closed axelcxyz closed 1 year ago

axelcxyz commented 1 year ago

I'd like to add Tesla.Middleware.Logger to the client when making requests. Is that possible?

It doesn't look like ExForce.Client.Tesla.build_client/2 supports it:

https://github.com/chulkilee/ex_force/blob/4181e26c8514312099cdde6e153fdaf60d3abe53/lib/ex_force/client/tesla/tesla.ex#L34

I was also looking into whether I could add the Middleware to the client after I get it back, but I couldn't find a way to modify a Tesla.Client after it is built.

Thanks!

axelcxyz commented 1 year ago

I see there is an open pull request for this:

https://github.com/chulkilee/ex_force/pull/71

axelcxyz commented 1 year ago

I ended up using this approach: https://github.com/chulkilee/ex_force/pull/42#issuecomment-766766017