Den onsdag den 16. november 2011 07.42.02 UTC+1 skrev Android Developer: > > > Before pushing application to market we need to remove Log statements. > if application contains more java files then its hard to remove one by > one. > > Its not particularly elegant, but for smaller projects I usually just declare somewhere a boolean
public static final boolean DEBUG = false; and then prefix my log invocations: if (DEBUG) Log.d(TAG,"blabla"); As the DEBUG variable is final the Java compiler should optimize out the log statements as they are never reachable (no need for proguard to do that). So, it works essentially like a hack to get #ifdef's in your code. Jacob -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en