标签:
在方法中加入以下代码:
Throwable throwable = new Throwable(); StackTraceElement[] stackElements = throwable.getStackTrace(); if (stackElements != null) { for (int i = 0; i < stackElements.length; i++) { System.out.print(stackElements[i].getClassName()+"/t"); System.out.print(stackElements[i].getFileName()+"/t"); System.out.print(stackElements[i].getLineNumber() + "/t"); System.out.println(stackElements[i].getMethodName()); System.out.println("---------------------------------------------------"); } }
标签:
原文地址:http://my.oschina.net/jgy/blog/364461