Enabling Debugging With The Swing SDK
All software has problems from time to time and to help track them down developers often include debugging functions in their products. EditLive! includes such a function to enable our support team to track down the cause of any problems, but in the past developers have had problems enabling it in the Swing SDK1. There are two common causes for that:
- We made enabling debugging in the Swing SDK too hard.
- Developers didn't include a simple way to enable debugging without having to recompile their software.
For the first problem, we've made improvements to help people out in the future. So with recent builds you can simply call ELJBean.enableDebugLogging() to turn on debugging. If you're using an older build you'll need to set the appropriate system properties (which is exactly what the enableDebugLogging method does for you).
The solution to the second problem depends on how you deploy your application and requires a bit of work on the developer's part. If you already have a debugging mechanism in your product, the best thing to do is to enable EditLive's debugging whenever your normal debugging is enabled.
If you don't yet have debugging in your application there are a few simple ways to expose the debugging switch to users:
- For applications started from the command line provide a command line option like -debug to enable debugging.
- For applications started from WebStart, you can use a command line option by adding an argument tag within the application-desc element of your JNLP file.
-
For standalone applications you could:
- Provide a separate launch script which enables debugging (eg: application.exe and application-debug.exe)
- Check for the presence of a particular file as a signal to output debugging information (eg: the user creates a application-debug.txt file in their home directory)
- Provide a user preference in your GUI. This will only take effect after restarting your application unless you're using a recent build of EditLive!
You should make sure and test that logging enables correctly just like any other part of your application - there's nothing worse than realizing your debugging is broken just when you really need it.
1 - when using EditLive! within a browser, the JavaScript SDK has always provided a simple setDebugLevel function. ↩

