Often I will send debugging info to my log file from within Java, and it helps to give decent information as to where in the code the log message was generated so I can quickly refer back to it. I don't want to hard-code anything in the log message about its location, because I have to remember to update the log message if I rename its method or otherwise refactor the code into a different structure. I'd love to have a static function that simply returns the calling function's class and method name. For example, if I have a class called Machine and a method called doStuff, I'd like my log message generation code in that method to look something like this:Often I will send debugging info to my log file