Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of logging in object level #3501

Open
wants to merge 12 commits into
base: trunk
Choose a base branch
from
Open

Conversation

Jintin
Copy link

@Jintin Jintin commented Dec 8, 2020

Add support of object level logging in order to increase readability for case like binary response we can't log in OkHttp layer.

High level changes:
Add one interface ObjectLogger with two implementation EmptyLogger and GsonLogger which print all attribute via gson.
Add new function setObjectLogger in Retrofit.Builder in order to set ObjectLogger from outside.
Add logging in SimpleService to test/verify easily.

Usage sample here:

Retrofit retrofit = new Retrofit.Builder()
    .baseUrl("https://api.example.com")
    .setObjectLogger(GsonLogger.create())
    .build();

Please let me know if there's any comment.
Thanks.

@Jintin Jintin changed the title POC of logging api result Add support of logging in object level Dec 11, 2020
@Jintin
Copy link
Author

Jintin commented Dec 11, 2020

btw I guess Android related build failed is normal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant