如何输出消息Eclipse控制台时,为Android开发 [英] How to output messages to the Eclipse console when developing for Android
问题描述
如何打印信息(如标志)到Eclipse控制台(或日志)开发和调试Android应用程序时,
How can I print messages (like a flag) to the Eclipse console (or log) when developing and debugging an Android app
推荐答案
而不是试图输出到控制台,登录
将输出到LogCat中,你可以在Eclipse中找到通过将:窗口 - >显示视图>其他... - > Android-> LogCat中的
Rather than trying to output to the console, Log
will output to LogCat which you can find in Eclipse by going to: Window->Show View->Other…->Android->LogCat
有一个看参考登录
。
使用LogCat中的好处是,你可以打印不同的颜色取决于你的日志类型,如: Log.d
打印蓝,日志。 Ë
打印橙色。您也可以通过筛选的的日志标签的 的日志信息的 进程id 和/或通过的的应用程序名的。当你只是想看看你的应用程序的日志,并保留其他系统不同的东西,这是非常有用的。
The benefits of using LogCat are that you can print different colours depending on your log type, e.g.: Log.d
prints blue, Log.e
prints orange. Also you can filter by log tag, log message, process id and/or by application name. This is really useful when you just want to see your app's logs and keep the other system stuff separate.
这篇关于如何输出消息Eclipse控制台时,为Android开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!