Is there a way to output a call trace for a particular thread in java?
I do not want a stack trace. I would like a sequence of calls on each object for tracing.
We could create a new Throwable object which will have the call trace. And using some string manipulations, we can get the call stack.
Throwable t = new Throwable(); System.out.println(t.getStackTrace()[1].toString());
I'm not sure retrieving the info this way , is a good practice or not. :)