Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
309 views
in Technique[技术] by (71.8m points)

android studio - Why are Log.d() and Log.v() not printing

I have the following test code in my Activity:

@Override
public void onStart() {
    super.onStart();
    Log.e(CLASS_NAME, "ERROR onStart()");
    Log.w(CLASS_NAME, "WARN onStart()");
    Log.i(CLASS_NAME, "INFO onStart()");
    Log.d(CLASS_NAME, "DEBUG onStart()");
    Log.v(CLASS_NAME, "VERBOSE onStart()");

On the logcat view in Android Studio, it only prints:

02-10 15:56:10.190    6194-6194/org.example.my_app E/MyActivity﹕ ERROR onStart()
02-10 15:56:10.190    6194-6194/org.example.my_app W/MyActivity﹕ WARN onStart()
02-10 15:56:10.190    6194-6194/org.example.my_app I/MyActivity﹕ INFO onStart()

On top of the box, the menu is set to Log level: “Verbose”, and if I go into the menu next to it, choose “Edit filter configuration”, “by Log Level” is also set to “Verbose”. Why are the Log.d() and Log.v() not printing anything? What might I am missing? Any suggestions would be appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Accepted answer not working

My solution:

when your Log.d is not working then Log.wtf is work

It's working for me, may be this is helpful to other, who find solution


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...