You can use the following expression in a conditional breakpoint:
android.util.Log.v("MyApp", "my message") == -1
This will make your breakpoints not break the execution and in the LogCat View, filtering the view using the tag:MyApp
expression, you will get the desired logged messages. You can also use other log levels (a
, i
, e
, w
). See the Log documentation for more info.
To have the breakpoint always break, use:
android.util.Log.v("MyApp", "my message") >= 0
The return value of Log.v
is the number of bytes the log message internally has, so it will always a positive number.
ADDENDUM:
There is a more elegant way to do it. Eclipse conditional breakpoints can be any java code, including using local variables at the breakpoint. The last return value must be true
if you actually want to stop execution or false
. So the same can be achieved as:
android.util.Log.v("MyApp", "my message");
return false;
or you can make more complicated statements like:
if( t.isNumber() ) {
System.out.println("A number found");
} else {
System.out.println("Not a number");
return true; // stops execution
}
android.util.Log.v("MyApp", "my message");
return false; // does not stop execution