Determining Current Call Stack (For Diagnostic Purposes)

前端 未结 4 590
面向向阳花
面向向阳花 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:27

    If you want it as a String and use Apache Commons:

    org.apache.commons.lang.exception.ExceptionUtils.getFullStackTrace(new Throwable())
    

提交回复
热议问题