Answer the question
In order to leave comments, you need to log in
Android how to remove logging?
Log.* - does not make sense in the release version, only slightly loads the system. To get rid of the logs, I saw this check: if (BuildConfig.DEBUG) {} . Maybe my question is stupid, but is there a way to automatically remove the call to all logs in the project? (After all, doing the check also takes some time, even nanoseconds)
Answer the question
In order to leave comments, you need to log in
Use proguard/r8.
In the proguard-rules.pro file write the following:
-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int println(...);
public static int v(...);
public static int i(...);
public static int w(...);
public static int d(...);
public static int e(...);
public static int wtf(...);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question