Monday, July 30, 2012

Android - Logs

Hello

Reading and Writing Logs

The Android logging system provides a mechanism for collecting and viewing system debug output. Logcat dumps a log of system messages, which include things such as stack traces when the emulator throws an error and messages that you have written from your application by using the Log class. 


The Log class


Log is a logging class that you can utilize in your code to print out messages to the LogCat. Common logging methods include:
For example:
Log.i("MyActivity", "MyClass.getView() — get item number " + position);
The LogCat will then output something like:
I/MyActivity( 1557): MyClass.getView() — get item number 1


Using LogCat



Filtering Log Output

Every Android log message has a tag and a priority associated with it.
  • The tag of a log message is a short string indicating the system component from which the message originates (for example, "View" for the view system).
  • The priority is one of the following character values, ordered from lowest to highest priority:
    • V — Verbose (lowest priority)
    • D — Debug
    • I — Info
    • W — Warning
    • E — Error
    • F — Fatal
    • S — Silent (highest priority, on which nothing is ever printed)
You can see output to Logcat via Eclipse

Export Logs

Log Collector - an app that can send the log on the device to your email,facebook, ...
Kyoro Logcat - an app that can send mail but more importantly can show you logs in REAL TIME !!


The following app was published using this post.


source - http://developer.android.com/tools/debugging/debugging-log.html

Nathan

No comments:

Post a Comment