【发布时间】:2016-02-08 01:43:51
【问题描述】:
我在 Java 中将此附加到我的打印语句中,并且它们有一个堆栈跟踪...
How can we print line numbers to the log in java
public static int getLineNumber() {
// The second row of the stack trace had the caller file name, etc.
return Thread.currentThread().getStackTrace()[2];
}
Haskell 我该怎么做?
【问题讨论】: