Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is LogCat in Eclipse?

What does LogCat do in Eclipse?

How do I use it? I have never used the log cat before in Eclipse, so I don't understand.

like image 387
Karate_Dog Avatar asked Aug 25 '11 09:08

Karate_Dog


People also ask

What is Logcat?

Logcat is a command-line tool that dumps a log of system messages, including stack traces when the device throws an error and messages that you have written from your app with the Log class. This page is about the command-line logcat tool, but you can also view log messages from the Logcat window in Android Studio.


2 Answers

This is a nice and quick way to exchange information from the application on your device and the development computer.

To use Logcat, first import android.util.Log into your project. Now you can call the static class Log from your project to start logging. As you can see below, Logcat has different levels of logging. When debugging, we’ll just use Debug (D) to log the progress. Of course, when you want to log an actual error, you will use Error (E).

V — Verbose (lowest priority)
D — Debug
I — Info
W — Warning
E — Error
F — Fatal
S — Silent (highest priority, on which nothing is ever printed)

For more detail, see Debugging in Android using Eclipse.

like image 99
Pratik Avatar answered Sep 22 '22 12:09

Pratik


LogCat is an Android feature that allows you viewing logs emitted by the applications running on an Android device.

When you are running your application in debugging mode from Eclipse, you can see plenty of logs appearing in this window: those of your own application, but also those posted by the system and other applications running at the same time on this device.

To log something, you have first to determine how your message is critical (is this debuggin info, an informational message, a warning or an actual error message?) and then use the appropriate method:

Log.d("myApp", "my debug message");  
Log.i("myApp", "my informational message");
Log.w("myApp", "my warning message");
Log.e("myApp", "my error message");
like image 37
Shlublu Avatar answered Sep 21 '22 12:09

Shlublu