void (String text, java.io.PrintStream ps) { X asdf = new X(); StackTraceElement[] element = asdf.getStackTrace2(); StackTraceElement dumper = element[2]; ps.println(text + " at " + dumper.toString()); }