are Android's debug logs really stripped at runtime?

前端 未结 3 1402
半阙折子戏
半阙折子戏 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:16

    No. You have to do this yourself. You can make your own Log.d wrapper like this:

    public static void debug(String tag, String msg) {
        if (BuildConfig.DEBUG) {
            Log.d(tag, msg);
        }
    }
    

提交回复
热议问题