我想在 Google Analytic 的报告中为我的移动应用程序提供整个堆栈跟踪。
我编写了打印堆栈跟踪的类并将其放入字符串中,但它不起作用。
我的习惯ExceptionParser
:
@Override
public String getDescription(String threadName, Throwable throwable) {
return threadName + " " + getStackTrace(throwable);
}
private String getStackTrace(Throwable throwable) {
final Writer result = new StringWriter();
final PrintWriter printWriter = new PrintWriter(result);
throwable.printStackTrace(printWriter);
return result.toString();
}
我这样设置:
EasyTracker.getTracker().setExceptionParser(new StacktraceExceptionParser());