Articles → Android → Logcat In Android

Logcat In Android






What Is Logcat?





Log Class





How To Open Logcat Window?




Picture showing how to open logcat window
Click to Enlarge


Format Of Log Messages




<Date><Time><process_id>-<thread id>/ <Priority>/<tag>:<message>




  1. Date - Specifies the date, when the log is created.
  2. Time - Specifies the time, when the log is created.
  3. Process Id - Specifies the current process.
  4. Thread Id - Specifies the current thread.
  5. Priority - What is the priority of message.
  6. Tag - Specifies the originator of message
  7. Message - Message you want to display in logcat window.

Priority




PriorityMeaningLog function syntax
VVerboseLog.v(tag, message);
DDebugLog.d(tag, message);
IInfoLog.i(tag, message);
WWarningLog.w(tag, message);
EErrorLog.e(tag, message);
AAssertLog.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");




Picture showing how string is written inside the logcat window using log.v
Click to Enlarge


Important Components Of Logcat Window




Picture showing the different parts of the logcat window
Click to Enlarge

  1. Device (or emulator) - Where android program is running
  2. Application Name - Name of the application.
  3. Priority - Specifies the priority
  4. Search box - For searching the log.
  5. Clear log -Delete all the logs from logcat window.



Posted By  -  Karan Gupta
 
Posted On  -  Friday, November 29, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250