Extract information about current method in Java
September 11, 2016 Leave a comment
Say you wish to get some simple information about the currently running function in your Java program. The stacktrace of the current thread can help you find that.
Here’s a simple snippet to print the class name, the file name, the line number and the method name: