LogCat 不显示标签“SMS”
@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
}
为什么 Logcat 中的日志记录对于上述代码中的某些行不起作用?
@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??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如前所述,有些标签不会进入默认缓冲区。
您可以通过使用“-b”logcat 选项指定要查看的缓冲区来查看它们。检查使用 LogCat< 的查看备用日志缓冲区部分/a> 查看不同的可用缓冲区。例如,要查看“SMS”logcat 消息,请使用以下命令启动 logcat:
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:
所有与电话相关的日志消息都有一个单独的缓冲区,这些消息不会出现在默认的 LogCat 窗口中。
There is a separate buffer for all telephony related log messages, whichwon't appear in default LogCat window.