Log in debug only?

by Pamplemousse Mk2 » Thu, 30 Jul 2009 16:06:40 GMT

Sponsored Links

I write a lot of logs in my program with the class android.util.Log.
Do the log methods (Log.v(), Log.d(), ...) are executed on the phone?
When my program will be finished, I won't like to see it try to output
logs in the release version.

I have seen that to make a conditional compilation (for Debug/Release
version), I can use a class like this:

public final class Debug {
          //set to false to allow compiler to identify and eliminate
          //unreachable code
          public static final boolean ON = false;

and use if to add debug codes:

if (Debug.ON) {
  // Do debug works...

If Debug.ON is false, the compiler removes the unreachable parts of
code, i.e. the ones inside this if. Should I do the same for Log
functions to be able to activate and deactivate them?


Other Threads

1. Is the EGL_CONTEXT_LOST error is occur on the Nexus One or other real devices ?


We are developing game for the Android platform using OpenGL ES for
drawing. The EGL specification states that EGL_CONTEXT_LOST error may
occur under some circumstances and there is constant in the Android
API for this error code, but we have never seen that error on real
Nexus One device (we are expected it when device is going sleep).

Is anybody was able to catch this error on the real devices ? I want
to know how I can get this error to check the correctness of codepath
handling this event.

Thanks in advance!


2. notification icon on left most corner

HI all

This is vinod  i have a problem  with notification icon in left most
i am able display notification icon but not required for me i need
show icon on left most corner in statusBar Please any body help me



3. Droid X available to buy now -- Engadget

4. Pendaftaran Pre-Order SGS di Telkomsel

5. data passed to handler overwritten?

6. Suhi Beraks

7. Update :) WTA: Desire kalo YouTube restart