Sea turtle
Sea turtle

Reputation: 467

How to debug in .rs file with RenderScript?

I want to add some log in fall.rs (in:packages\wallpapers\Basic\src\com\android\wallpaper\fall). And the code is like this:

int root(void) {

rsDebug("===========root==================",0);
rsgClearColor(0.f, 0.f, 0.f, 1.f);
...

}

But my device can't print any log when I set live wallpaper. Although there are many examples about "rsDebug", but I can't find what's wrong when I use "rsDebug".

Upvotes: 4

Views: 2724

Answers (2)

Sheriff Md
Sheriff Md

Reputation: 656

To see all renderscript debug messages from logcat, use:

adb logcat -s RenderScript:D

To filter for your specific application, add a prefix in the rsDebug message:

rsDebug("==MyApplication== my debug message", 0);

and filter in logcat:

adb logcat -s RenderScript:D | grep ==MyApplication==

Upvotes: 1

Stephen Hines
Stephen Hines

Reputation: 2622

What kind of device is this (and what version of Android is it running)? Also, rsDebug logs at the "D" (Debug) level, so if you are filtering logcat, you might just not be seeing it. Do you see any messages tagged as "D"?

Upvotes: 2

Related Questions