LOGV

390 views
Skip to first unread message

André Barbosa

unread,
Mar 17, 2010, 12:32:19 PM3/17/10
to android-ndk
Dear All,

I'm running the mediaplayer of android and i would like to see the
LOGV generated by mediaplayer, but they do not appear in logcat.
these logs are stored in a file? how can I debug them?

Regards,
André Barbosa.

Syl

unread,
Mar 18, 2010, 6:18:04 AM3/18/10
to android-ndk
I don't know if it is the same problem.
Personnaly, I am trying to compile a JNI program on Android and it
calls some LOGV, LOGI... macros. However, with original code,
compilation crashes because these macros are not found.

So, I define in a myLogMacro.h file :

#ifndef MY_LOG_MACRO_H
#define MY_LOG_MACRO_H

#include <android/log.h>

//redefinition des macros
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE,
"MY_LOG_TAG", __VA_ARGS__)
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG ,
"MY_LOG_TAG", __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO ,
"MY_LOG_TAG", __VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN ,
"MY_LOG_TAG", __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR ,
"MY_LOG_TAG", __VA_ARGS__)

#endif // MY_LOG_MACRO_H


Then, include this myLogMacro.h file in the other CPP files and call
LOGV, LOGD... like this to get log in LogCat :
LOGV("A message with str=%s and int=%d", "a string", 3)


André Barbosa a écrit :

André Barbosa

unread,
Mar 24, 2010, 11:01:52 AM3/24/10
to android-ndk
hi all,
i want to see all the logs of android source code, i already tried
alter the log.h (system/core/include/cutils), however, when i compile
the android source code, the compile show me errors on some cpp files.

Someone already did this change? what i have to modify in log.h to
activate all logs (LOGE, LOGI, LOGD, LOGV, LOGW)?

Regards,
André Barbosa

Reply all
Reply to author
Forward
0 new messages