Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 290
Emanuil Rusev Avatar asked Oct 09 '22 20:10

Emanuil Rusev


People also ask

How do I get full console output in Eclipse?

It can be changed by going to Windows --> Preferences --> Run/Debug --> Console and then unchecking "Limit Console Output" which is ON by default. This works on STS any version too. This would help printing complete console output. For a Mac it is Eclipse > Preferences > Run/Debug > Console.

How do I get output in Eclipse?

Inside Eclipse -> Click on "Window" Select "Show View" Then select "Console" If you cannot see console in the list, select "Other" and then search for "console' in new dialog at top and select "Console"

What does pin console do in Eclipse?

] to ensure that the current console remains on top of all other consoles.


1 Answers

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.

like image 153
m6tt Avatar answered Oct 21 '22 04:10

m6tt