Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
Debugging Applications : Utilizing debugging in your application

Utilizing debugging in your application

Any WebSpeed application has access to the WebSpeed global variable debug-options. You can turn on debugging selectively by setting this variable to a comma-separated list of options. As long as your SpeedScript Web object includes {src/web/method/cgidefs.i} (this is true by default), you have access to this variable.
The options you can set include cookie,http,all, among others. The complete list of options resides in install-path/src/web/support/prinval.p, the WebSpeed procedure that outputs the debugging information for Web pages.
The following code tests if "all" debugging is enabled:
IF CAN-DO(debug-options,"all") THEN DO:
/* add code here */
The CAN-DO() function compares the second argument with the first, which would be a comma separated list of options If "all" is found in this list, it evaluates to TRUE and executes the SpeedScript in the block.
The following code tests for a custom debugging option called "login" as well as "all":
IF CAN-DO(debug-options, "login") OR CAN-DO(debug-options,"all") THEN DO:
/* add code here */
If you specified debug=login, debug=all, debug=login, or admin (to name a few), this section of code is executed.
If you use your own debugging options, make sure your application ignores all options it does not understand. Never test the value of the debug-options variable for equality. Always test using the CAN-DO() function to see if your custom options are among the listed ones.
* Reading the broker's log files