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

How to ensure logging only for DEBUG build? #68

Closed
hasancse91 opened this issue May 10, 2021 · 1 comment
Closed

How to ensure logging only for DEBUG build? #68

hasancse91 opened this issue May 10, 2021 · 1 comment
Labels

Comments

@hasancse91
Copy link

hasancse91 commented May 10, 2021

Firstly, thanks a lot for your awesome library.

In previous version (3.0.0) we used .loggable(BuildConfig.DEBUG) for logging network log only for DEBUG build. Right now (in 3.1.0 version) this method is deprecated and suggested to replace this method with .setLevel(Level.BASIC).

Is this .setLevel(Level.BASIC) method ensure logging only in DEBUG build?
I've tested using this method in release build. Still network log is showing in console (for testing purpose I made debuggable true for release build).

What is your recommended way to ensure LOGGING in debug build and NOT LOGGING in release build?

@ihsanbal
Copy link
Owner

BASIC logs url, method, headers and body as you can see in this link https://github.com/ihsanbal/LoggingInterceptor#level
Yeah I know loggable was more useful for different build variants but setLevel provides more flexibility to developers. I can recommend you to use something like below.

.setLevel(BuildConfig.DEBUG ? Level.BASIC : Level.NONE)

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

No branches or pull requests

2 participants