Just playing around with Log.isLoggable(tag, level) method.

            Log.d(LOGTAG, "--- debug log");
            Log.i(LOGTAG, "--- info log");
            if (Log.isLoggable(LOGTAG, Log.INFO)) Log.i(LOGTAG, "---
isLoggable info log");
            if (Log.isLoggable(LOGTAG, Log.DEBUG)) Log.d(LOGTAG, "---
isLoggable debug log");

These all send output to the log except the last.

Following the instructions in the API for Log.isLoggable I used adb to
set the value of LOGTAG to DEBUG as follows -

# setprop com.foo.bar DEBUG

where "com.foo.bar" is the value of LOGTAG. But the 4th Log still does
not print.  I tried stopping and restarting the emulator and removing
and reinstalling the app and setting the property before the app
started. No luck so far.

I was assuming the mechanism would allow me to turn up the logging
verbosity on a running app, but so far I don't get isLoggable to do
anything at all.  Any suggestions?

Related questions:
- What API call will get the values that you see with "adb shell
getprop"?
- isLoggable suggests creating a /data/local.prop file.  Is the idea
to copy that file onto the device or is there another way?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to