Hi all,
I have been using the following conventions for my applications:
- I define a static log(String msg) function centrally as:
public static void log(String msg) {
if (LOG) Log.v(msg);
}
- While debugging, LOG is true. For production, LOG is false.
- Throughout the code, I will then log with functions like:
MainApp.log("This is a logged message, variable a="+a);
My question is, if I set LOG to false, will the compiler recognize
that the entire log function is useless and not even perform the
string concatenation? Or, will it perform the string concatenation,
but then immediately disregard the results? Obviously, I prefer the
former (fewer ops = better), but I don't know how to check for this.
Thanks,
jsdf
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---