Android documentation ( http://developer.android.com/reference/android/util/Log.html ) says:
Verbose should never be compiled into an application except during development. Debug logs are compiled in but stripped at runtime. Error, warning and info logs are always kept
I just did a test. In my activity I wrote:
private static String test(String what) {
Log.e("test", "I am called with argument: " + what);
return what;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.v("test", "log level: " + test("v"));
Log.d("test", "log level: " + test("d"));
Log.i("test", "log level: " + test("i"));
Log.w("test", "log level: " + test("w"));
Log.e("test", "log level: " + test("e"));
}
I exported my project as an apk file, then I installed this apk on my phone. I run this application on my phone, then I looked at logs. There I saw that the function test was called all five times and all five calls to Log.something functions resulted in its text being written to logs.
So are Log.d calls really stripped at runtime?