Logging values of variables in Android native ndk

后端 未结 4 1781
甜味超标
甜味超标 2021-01-30 16:33

I set up logging with C++ in Android NDK.

I can print a message to logcat like this:

__android_log_write(ANDROID_LOG_INFO, \"tag here\", \"mess         


        
4条回答
  •  甜味超标
    2021-01-30 16:40

    You could use __android_log_print which uses a sprintf-like syntax that formats your data into a string.

    __android_log_print(ANDROID_LOG_INFO, "sometag", "test int = %d", testInt);
    

提交回复
热议问题