| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Using Log to debug applications

Page history last edited by Will 12 years, 9 months ago

Log is an API for sending log output

Log can help you debug your code or provide the end user information on what is going on.

 

There are three versions of the log routine, they are: Log.v(), Log.i(), and Log.d().

 

Log.v() - Is used for verbose logging

Log.i() - Is used for general information notification

Log.d() - Is used for error checking and debugging typically used during application development

 

Syntax:

     Log.v(String tag, String msg);

     Log.i(String tag, String msg);

     Log.d(String tag, String msg);

 

Parameters:

tag Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.
msg The message you would like logged.

 

Examples:

       String TAG = "SkeletonActivity";

 

       Log.v(TAG, "Hello");
       Log.i(TAG, "Hello");
       Log.d(TAG, "Hello");

 

$ adb.exe logcat *

 

Comments (0)

You don't have permission to comment on this page.