On Jun 13, 3:47 am, westmeadboy <[email protected]> wrote:
> My code is something like:
>
> if (Log.isLoggable("mytag", Log.DEBUG)) {
>     Log.d("mytag", "Logged at debug level");
>
> }
[...]
> However, if we remove the if statement then shouldnt the Log.d()
> statement do nothing?

All log statements get written to the log file.  If that weren't the
case, the Log.isLoggable call would be redundant.

This is more meaningful for something like:

  if (Log.isLoggable("blah", Log.DEBUG)) {
    Log.d("blah", "This " + i + " another " + thing + " xyzzy");
  }

Here, the call to Log.isLoggable avoids allocating a StringBuilder and
performing several concatenation operations.


> So neither of those work for me. What am I doing wrong? Is eclipse
> somehow overriding my settings?

You can verify that the property has been set with "getprop".

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to