java: printing current backtrace [duplicate]
问题 This question already has answers here : How can I get the current stack trace in Java? (22 answers) Closed 6 years ago . is there a way to add a command in Java to add the current backtrace ? I'm writing a red5 application and the appDisconnect function is being called twice. whenever a user changes room. I want to add a function at the beginning of the appDisconnect function that shows the current backtrace and then I can see what called it. thanks 回答1: You can output the stack trace to the