One of the cool aspects of jwee is the built-in development tools. It helps us to build jwee and it will help you to use jwee, if you take advantage of it. The debugging tools are an optional add-on. While writing code during developement time, you would want to use a jwee package with debugging. When its time to launch your code into production, repackage jwee without debugging.
Jwee's Debugging Console
- To view the log console, press the CONTROL-SHIFT-ALT-D key. (Try it now!)
- Hitting ESC, once or numerous times, will hide any debugging frames one by one..
How to output to the log
- Use jwee's logging function trace().
Instead of using console.log, or alert heaven forbid, use jwee's trace() function. It is a global function, and can be called from anywhere at anytime. It can be called before the page loads as well. If the browser's own console is open (such as firebug in firefox), trace() will also output to there. When you hit the CONTROL-SHIFT-ALT-D key, while viewing a page, jwee's console will fly in. Hit ESC to hide it.
The trace() function takes a string, or multiple strings. Here is an example of usage:
// You can output like this
trace( "I got here - note to self" );
// You can output variables
var X = "foo";
trace( "Variable X equals " + X );
// Its often easer to pass variables as additional arguments
// Jwee will automatically add spaces in the output
trace( "Variable X equals", X );