如何打印堆栈跟踪的异常机器人 [英] How to print stacktrace for an exception Android
本文介绍了如何打印堆栈跟踪的异常机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要打印的堆栈跟踪,因为在现阶段,我有这个运行。
}赶上(IOException异常E){
抛出新的错误(复制失败);
}
和我被告知要打印 e.stacktrace();
我如何做到这一点?
解决方案
}赶上(IOException异常E){
Log.e(YOUR_APP_LOG_TAG,我得到一个错误,E);
}
和检查LogCat中的输出。
I want to print the stack trace because at the moment I have this running.
} catch (IOException e) {
throw new Error("Copying Failed");
}
And I have been told to print e.stacktrace();
How do I do this?
解决方案
} catch (IOException e) {
Log.e("YOUR_APP_LOG_TAG", "I got an error", e);
}
And check the LogCat for the output.
这篇关于如何打印堆栈跟踪的异常机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文