How to allow android logging in a shared library? -


i compiling 3rd party c library android app shared library. add android logging source code of c library can see methods gets called, arguments. can not make work. tried following:

  1. add -llog android.mk c library

    local_cflags := := ... -llog

  2. add header file source file abc.c want log

    #include < android/log.h>

  3. add line

    __android_log_print(android_log_debug, "myapp", "this method x");

error: __android_log_print not recognized.

what should make work?

__android_log_print takes variadic, printf-like arguments after 3rd one. use

__android_log_write(android_log_debug, "myapp", "this method x"); 

instead, no-extra-arguments logging.

edit: -llog linker flag, not compiler one. remove

local_cflags := := ... -llog 

and instead write

local_ldlibs := -llog 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -