android 打印日志及运行堆栈

sancaiodm Android 2022-03-16 1434 0

c++文件中打印Log

#include <utils/CallStack.h>

android::CallStack stack;

stack.update();

android::String8 strtemp = stack.toString("");

ALOGD("\t%s", strtemp.string());


Makefile文件内打印log

$(warning "-----------androidos.net----------")

$(info "--------androidos.net---------------")



Java 文件中打印log

android.util.Log.i(TAG,"androidos.net",new Exception());

评论