|
[android-beginners] Log in debug only?: msg#01163AndroidBeginners
Hello, 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? Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@xxxxxxxxxxxxxxxx To unsubscribe from this group, send email to android-beginners-unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---
|
|
||||||||||||||||||||||||||
|
|
|
| News | Mail Home | sitemap | FAQ | advertise |