Log in Android

                       Trace Android Issues

Log:

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. You can run LogCat through ADB or from DDMS, which allows you to read the messages in real time.


This is like System.out in java or printf in C language.

Where ever you want to trace the values you can use this.

Types of logs:

* Verbose - v(String , String)
* Debug    - d(String , String)
* Info        - i(String , String)
* Warning - w(String , String)
* Error      - e(String , String)

We can also able to filter them.

Example:


int A = 10;
Log.d(this.toString,"Current Value of A "+ A);

The above code will produce 10 as answer.


Comments

Popular posts from this blog

Android Project Structure 2012

Share Data Across Application in Android

Developer Practices - Non Technical 2017