Any way to remove logging calls without using ProGuard optimization?
I have a wrapper class for making log calls during development. This makes it easy to turn all logging on or off at any given time (plus some other nifty features). Previously I used a specific ProGuard optimization to remove this class during release, which also removed the calls to the cl开发者_开发问答ass's static methods (so no log strings were left behind).
Unfortunately because of this, I have to disable ProGuard's optimization feature. While I can easily turn off the logging, all of my log strings are still visible in the resulting apk, and unless I'm missing something, there is no other way in ProGuard to remove them.
Is there any other way to remove these strings when building a release package in the Eclipse GUI? (not ANT)
I don't know where you string literals are etc. but to simulate a ifdef debug statement you would do something similar to this which may be trivial if you can just wrap all the affected inner class/method/var's of your debugging class in such a statement.
Apparently the compiler removes anything it finds in that block as more or less dead code, or so I have read, never checked it out though.
精彩评论