The more complex the gadget the more you are going to depend on servicability in order to debug problems with your app in production. We need to be able to place a gadget in "debug" mode in order to enable an app to start outputting the valuable debug information. Today we support gadgets.log, gadgets.warn, gadgets.info, and gadgets.error. We can also set the log level using gadgets.setLogLevel to set a logging level within the gadget. However this does not allow you to set a logging level for a specific "module" in your gadget. If your code is complex enough you may be writing numerous modules to encompas your code. When enabling logging in this code you probably want to do it on a per module basis and not enable logging for your entire app. Today we don't have support for this in the spec.
One possible way to do this is to use the SUPPORT view, or some other view, of your gadget in order to allow the user to enable logging in your gadget. (You pass some view parameters from the SUPPORT view to other views of you gadget indicating debugging is enabled.) However you will have to role your own solution for logging different modules in your gadget.
This should have the same functionality as the solution one but instead of the gadget managing the UI for enabling debugging the container does it. Very similar to how the container can display gadget preferences.
<ModulePrefs title="Developer Forum"
<DebugModule id="org.opensocial.module1" description="this is a very important module"/>
<DebugModule id="org.opensocial.module2" description="this is a semi-important module"/>
... content ...
Indicates whether the gadget is in debug mode or not.
Returns true if the gadget is in debug mode false if it is not.
Sets whether the gadget is in debug mode.
isDebug - boolean indicating whether the gadget is in debug mode