views:

135

answers:

2

Hi, I am working on an Android Application where I need to display log information when I execute the .apk file in release mode based on some condition. It can be like below:

if(debug)
   display log inf.
else
  normal execution

I will set this variable to true to enable debug mode to display log information. Can anyone help me in achieving this feature.

Thanks In Advance.

+3  A: 

Why don't you use the Log-function of Android via

Log.v(YourClass.class.simpleName(), "this is your verbose log text");

If you connect your phone to your computer and install the apk-file on your mobile phone (via Eclipse) you can use the phone like the emulator and watch the log entries in the DDMS.

See also: http://developer.android.com/guide/developing/tools/ddms.html, http://developer.android.com/reference/android/util/Log.html

chromate
A: 

Hi there, new to Android and just looked at http://developer.android.com/reference/android/util/Log.html

My question is regarding everything except debug. How do these Log entries get cleared such as Error so that they don't consume space? Also, Is there a way that the logfile can be queried so that it can be sent to a central web service or something for quality purposes etc.?

Thanks in advance for your time and please excuse the newbie question.

thanksssssssssssss
Android_programmer_camera