Determining Current Call Stack (For Diagnostic Purposes)

前端 未结 4 595
面向向阳花
面向向阳花 2020-11-27 15:26

For diagnostic purposes I sometimes need to store the call stack that lead to a given state transition (such as granting a lock, committing a transaction, etc.) so that when

4条回答
  •  悲哀的现实
    2020-11-27 16:14

    I think you can get the same thing with:

    StackTraceElement[] cause = Thread.currentThread().getStackTrace();
    

提交回复
热议问题