are Android's debug logs really stripped at runtime?

前端 未结 3 1397
半阙折子戏
半阙折子戏 2021-02-13 19:41

Android documentation ( http://developer.android.com/reference/android/util/Log.html ) says:

Verbose should never be compiled into an application except d

3条回答
  •  余生分开走
    2021-02-13 20:35

    This issue was reported here and a solution was provided in ADT 17.0.0 in Mar 2012

    Added a feature that allows you to run some code only in debug mode. Builds now generate a class called BuildConfig containing a DEBUG constant that is automatically set according to your build type. You can check the (BuildConfig.DEBUG) constant in your code to run debug-only functions.

提交回复
热议问题