How do I enable/disable log levels in Android?

后端 未结 18 2168
无人共我
无人共我 2020-11-22 16:42

I am having lots of logging statements to debug for example.

Log.v(TAG, \"Message here\");
Log.w(TAG, \" WARNING HERE\");

while deploying t

18条回答
  •  长发绾君心
    2020-11-22 17:15

    The easiest way is probably to run your compiled JAR through ProGuard before deployment, with a config like:

    -assumenosideeffects class android.util.Log {
        public static int v(...);
    }
    

    That will — aside from all the other ProGuard optimisations — remove any verbose log statements directly from the bytecode.

提交回复
热议问题