且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

获取Java中的当前堆栈跟踪

更新时间:2023-12-03 23:28:22

您可以使用 主题 .currentThread()。getStackTrace()

You can use Thread.currentThread().getStackTrace().

返回 StackTraceElement 表示程序的当前堆栈跟踪。

That returns an array of StackTraceElements that represent the current stack trace of a program.