It appears that Logger.inferCaller should be able to use Throwable.getStackTrace
to infer caller stack information. There is a comment in the code which says:
// This is an initial implementation.
// We may get VM support later.
It seems that Throwable.getStackTrace is the VM support for which this code was
waiting.
Using getStackTrace should be more robust and efficient than printing stack
trace ouput to a byte array output stream.
to infer caller stack information. There is a comment in the code which says:
// This is an initial implementation.
// We may get VM support later.
It seems that Throwable.getStackTrace is the VM support for which this code was
waiting.
Using getStackTrace should be more robust and efficient than printing stack
trace ouput to a byte array output stream.
- duplicates
-
JDK-4463604 logging: Logger.inferCaller is non-portable
-
- Closed
-