Open In App
Related Articles

Logcat Window in Android Studio

Improve Article
Save Article
Like Article

LogCat Window is the place where various messages can be printed when an application runs. Suppose, you are running your application and the program crashes, unfortunately. Then, Logcat Window is going to help you to debug the output by collecting and viewing all the messages that your emulator throws. So, this is a very useful component for the app development because this Logcat dumps a lot of system messages and these messages are actually thrown by the emulator.

This means, that when you run your app in your emulator, then you will see a lot of messages which include all the information, all the verbose messages, and all the errors that you are getting in your application. Suppose, an application of about 10000 lines of code gets an error. So, in that 10000 line codes, to detect the error Logcat helps by displaying the error messages.

Errors in different modules and methods can be easily detected with the help of the LogCat window.

Using LogCat window:

The LogCat prints an error using a Log Class. The class which is used to print the log messages is actually known as a Log Class. So, this class is responsible to print messages in the Logcat terminal.

There are lots of methods that are present in the log class:

v(String, String)


d(String, String)


i(String, String)


w(String, String)


e(String, String)


All these methods contain two parameters in them. The first and second both are the string. When you print the log messages with these different methods, then you will get a corresponding color according to the method.

Method The output will be printed in 











The verbose method is of very lesser priority and error is of higher priority. Thus, the method’s priority increases from verbose to error.


// for verbose Log.v("TAG", "MESSAGE");
// for debug Log.d("TAG", "MESSAGE");
// for information Log.i("TAG", "MESSAGE");
// for warning Log.w("TAG", "MESSAGE");
// for error Log.e("TAG", "MESSAGE");

For Example, A verbose log message can be written as:

Log.v("MainActivity", "We are under the Main Activity");
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 30 Aug, 2022
Like Article
Save Article
Similar Reads