Last active
November 19, 2019 18:09
-
-
Save RoRoche/1a3ab48b7f3839a209f5e40318c9d096 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.util.Log | |
import okhttp3.Response | |
class LoggableRequest( | |
origin: RestRequest, | |
private val tag: String = origin.javaClass.simpleName | |
) : RestRequest.Wrap(origin) { | |
override fun response(): Response { | |
Log.d(tag, "response - started") | |
val response = super.response() | |
Log.d(tag, "response - done with $response") | |
return response | |
} | |
override fun cancel() { | |
Log.d(tag, "cancel - started") | |
super.cancel() | |
Log.d(tag, "cancel - done") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment