-
Notifications
You must be signed in to change notification settings - Fork 94
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
Only log debug and verbose output for DEBUG builds. #118
Conversation
Ideally, verbose logging should not be compiled into an application except during development and debug logging should be stripped at runtime.
This and #116 can coexist. The bigger issue is that probably ProGuard is not correctly configured. It should take care of removing debug logs instead of doing it with if check. |
I'll be happy to create a PR with ProGuard configuration that strips out the debug logs if that's a preferred solution for you. You can surely merge #116 if you want but it's a useful debug print imo. |
Since you've already created a wrapper class for your logging function I think this PR is a good solution. |
👍 I am fine with both PRs and would say that this is a "quick" fix while I agree that the real solution would be to go for ProGuard afterwards. Simply to get rid of any potentially expensive string concatenation within a debug statement which of course gets executed before the debug level gets checked. |
As we do not have to rush, I think the best way would be to go with proGuard and even revert #116. |
What's the verdict here? |
@mario @tobiasKaminsky what's your opinion? I am fine with merging this PR as-is and let @ardevd go for the proGuard implementation also (in a separate PR, as stated). |
I'll get started on the ProGuard stuff soon. However I'll have to make a PR for the Android project as well since it's there the actual obfuscation and stripping will take place. |
https://medium.com/@elye.project/checking-debug-build-the-right-way-d12da1098120 indicates that it might be a problem, if this is used in a module.
seems to be a better way. |
I also think it is better to do it with ProGuard so that we do not even use the log calls. |
Ideally, verbose logging should not be compiled into an application except during development and debug logging should be stripped at runtime according to the Android developer documentation.
This PR at prevents debug and verbose output logging on non-DEBUG builds.
Fixes #116