Is there a way to add a command in Java to add the current backtrace?
I am writing a red5 application and the appDisconnect function is called twice. when the user changes the room. I want to add a function at the beginning of the appDisconnect function, which shows the current backtrace, and then I can see what is called.
thanks
You can output the stack trace to the current line as follows:
new Exception().printStackTrace();
Or, if you need soft keys, stacktrace elements that you can use
Thread.currentThread().getStackTrace()
The only way I know is to look:
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
Although this looks more like a logging problem than actually monitoring call tracing. You can also try debug execution in your IDE and add some well-placed breakpoints.
logging
debug
Source: https://habr.com/ru/post/1340779/More articles:How to use Marshal.QueryInterface? - c #Window Positioning C ++ Qt - c ++How can I add my Android app for the Share dialog? - androidNo page_PreLoad on the main page? - c #Enabling / disabling registration in the Enterprise Library - c #It is a mini dump useful for debugging in .NET. - debuggingbash - how to find the current shell command - bashHow to change the color and size of the TabControl border? - .netjQuery Checking error placement - jqueryHow to capture result from rundll32 call? - javaAll Articles