How to output messages to the Eclipse console when developing for Android

后端 未结 5 2038
花落未央
花落未央 2020-12-22 20:05

How can I print messages (like a flag) to the Eclipse console (or log) when developing and debugging an Android app

5条回答
  •  半阙折子戏
    2020-12-22 20:58

    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

    Have a look at the reference for Log.

    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.

提交回复
热议问题