For better debugging, I would often like to:
Exception at com.example.blah.Something.method() at com.example.blah.Xyz.otherMethod() at com.example.hello.World.foo() at com.example.debug.version_3_8_0.debug_info_something.Hah.method() // synthetic method at com.example.xAwrappingMethod()
The debug stack frame, as shown above, will be dynamically generated, like java.lang.reflect.Proxy , except that I would like to fully control the entire fully qualified name of the method, which ends on the proxy server.
On the call site, I would do something stupid and simple:
public void wrappingMethod() { run("com.example.debug.version_3_8_0.debug_info_something.Hah.method()", () -> { World.foo(); }); }
As you can see, wrappingMethod() is a real method that ends with a stack trace, Hah.method() is a dynamically generated method, while World.foo() again a real method.
Yes, I know that it pollutes the already deep deep traces of the stack. Do not worry about it. I have a reason.
Is there a (simple) way to do this or something similar as above?
source share