Android Basics – How to Add Log to your Class for Debug Purpose

Using Log statements in your Android Project is both useful and important. It will help you to debug problems.

 

The following Log levels are available in Android

  • Debug
  • Verbose
  • Error
  • Warn
  • Info
  • Error
  • Assert

To add a Log statement to your MainActivity Class simply add the following code statement to the onCreate method.

Log.v(MainActivity.class.getSimpleName(), “In onCreate”);