barmaley barmaley - 18 days ago 5
Android Question

Logging strategy

I'm about to finish my Android application. In the end I have found that I've been using bunch of logging statements, like:

Log.d(TAG, "Blah-blah");


The question is: for production release what should I do with them?


  1. Just comment/stripe log statements

  2. Do something else more sophisticated? Like as I used to do with Log4J properties or so



Please share your experience.

Answer

I do it like this, making the compiler remove all logging if DEBUG is false:

if (Constant.DEBUG) Log.d(TAG, "mein gott, state is roflcopter");