- Java
Log.d("Tag", "Message", new Throwable());
- C语言
#include <utils/CallStack.h>
CallStack::logStack("Tag", CallStack::getCurrent().get(), ANDROID_LOG_DEBUG);
CallStack::logStack("Tag");
static void ALWAYS_INLINE logStack(const char* logtag, CallStack* stack = getCurrent().get(),
android_LogPriority priority = ANDROID_LOG_DEBUG) {
if (reinterpret_cast<uintptr_t>(logStackInternal) != 0 && stack != nullptr) {
logStackInternal(logtag, stack, priority);
} else {
ALOG(LOG_WARN, logtag, "CallStack::logStackInternal not linked");
}
}