2

When native part(C++, Qt) of my program crashed I see in logcat some stacktrace. But this messages don't have application name, only "DEBUG" tag. That's why I can not get it for sending crash report (I use ACRA) beacuse "since JellyBean logcat provides only traces from your own app" How I can get it or do that they were writing in the name of my application?

Sorry for my bad english, Thanks!

Dmitry
  • 369
  • 4
  • 18

1 Answers1

2

You could use the following way (checkout this thread): create header with the following content:

#include <android/log.h>

#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, "libnav",
__VA_ARGS__)
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG  , "libnav",
__VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO   , "libnav",
__VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN   , "libnav",
__VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR  , "libnav",
__VA_ARGS__)

#endif // ANDROID_ALOG_H 

or just use __android_log_print directly.

sandrstar
  • 12,503
  • 8
  • 58
  • 65
  • It was already asked here - http://stackoverflow.com/questions/8415032/catching-exceptions-thrown-from-native-code-running-on-android – sandrstar Feb 20 '13 at 11:12
  • Thanks but it is not what I had in mind. I have this function already, but they don't use by system libraries that print stacktrace in SIGSEGV handler for example... I can set my handler for SIGSEGV but don't know how get stacktrace from it... – Dmitry Feb 20 '13 at 11:55
  • oh, so it seems to be continue of https://groups.google.com/forum/#!msg/android-developers/6U4A5irWang/8ar5-9lLmaAJ discussion – sandrstar Feb 20 '13 at 12:09