Kucoin / kucoin-futures-java-sdk

MIT License
14 stars 14 forks source link

No logging to debug what is communicated #12

Open ManufactoryOfCode opened 2 years ago

ManufactoryOfCode commented 2 years ago

It is common practice to have some kind of logging to be able to debug the communication. This will require to introduce a logging interceptor right after the actually used AuthenticationInterceptor. However in order to not close the underlying buffers, it is good to upgrade retrofit2 version (currently 2.9.0), so that response.body().source().peek() function will be introduced in class RealBufferedSource. This function allows to clone the source and that way preserve the source for later use yet be able to log the response body at the same time.