Articles → Android → Logcat In Android
Logcat In Android
What Is Logcat?
Log Class
How To Open Logcat Window?
Click to Enlarge
Format Of Log Messages
<Date><Time><process_id>-<thread id>/ <Priority>/<tag>:<message>
- Date - Specifies the date, when the log is created.
- Time - Specifies the time, when the log is created.
- Process Id - Specifies the current process.
- Thread Id - Specifies the current thread.
- Priority - What is the priority of message.
- Tag - Specifies the originator of message
- Message - Message you want to display in logcat window.
Priority
Priority | Meaning | Log function syntax |
---|
V | Verbose | Log.v(tag, message); |
D | Debug | Log.d(tag, message); |
I | Info | Log.i(tag, message); |
W | Warning | Log.w(tag, message); |
E | Error | Log.e(tag, message); |
A | Assert | Log.wtf(tag, message); |
Example
Log.v("verbose_tag", "This is the verbose tag");
Log.d("debug_tag", "This is the debug tag");
Log.i("info_tag", "This is the info tag");
Log.w("warning_tag", "This is the warning tag");
Log.e("error_tag", "This is the error tag");
Log.wtf("assert_tag", "This is the assert tag");
Click to Enlarge
Important Components Of Logcat Window
Click to Enlarge
- Device (or emulator) - Where android program is running
- Application Name - Name of the application.
- Priority - Specifies the priority
- Search box - For searching the log.
- Clear log -Delete all the logs from logcat window.