问题
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Log.e("SMS","Hello World"); //not showing
Log.v("SMS","Hello World"); //not showing
Log.i("SMS","Hello World"); //not showing
Log.d("SMS","Hello World"); //not showing
Log.i("sms","Hello World"); //showing
}
Why the Logging in the Logcat is not working for some line in the above code??
回答1:
There are some tags that don't go to the default buffer, as has been stated.
You can view them by specifying which buffer to view with the "-b" logcat option. Check section Viewing Alternative Log Buffers of Using LogCat to view the different buffers available. For example, to see the "SMS" logcat messages, start logcat with:
adb logcat -b radio
回答2:
There is a separate buffer for all telephony related log messages, whichwon't appear in default LogCat window.
来源:https://stackoverflow.com/questions/8699756/logcat-not-displaying-tag-sms