Understanding and Using Debug Mode
Much of a RidgeStar Interactive Site is interactive, operates in real-time, and is driven by the current status of one or more Database Tables. Many of the web pages produce information, like results lists, based on a dynamically created SQL (Structured Query Language) construct that is executed by the backend database.
Additionally, various functions on the site contain multiple internal messages, value settings, etc. that are useful when looking at how a particular page or function is operating from an "Internals" standpoint. Much of this information is of no consequence to a typical Visitor and, in fact, to 99% of the SiteManagers. However, when something isn't quite going right and one of the RidgeStar technicians needs to debug a bit of logic, we may need to "trigger" certain internal elements (such as dumping of internal arrays, calling lists, etc.) without being forced to manually change the pages.
- Turning ON Debug mode
- You can activate debug mode by adding the keyword sequence "debug=1" to any interactive page. You need to understand how HTTP uses the question mark (?) and ampersand (&) to separate keywords from the page name, but here's an example using this page of what you'd put in the Address/Location area:
http://ridgestar.com/debugmode.php?debug=1
- Turning OFF Debug mode
- To disable debug mode, add the keyword sequence "debug=0" to any interactive page, as
http://ridgestar.com/debugmode.php?debug=0
What happens when Debug is on?
The specific output associated with Debug Mode differs from page to page depending on what the RidgeStar Technician programmmed for Debugging purposes on the page.
The following element is an example of how a Debug result might appear:
ridgestar\csa->Debug from /home/ridgestar/rsr/www/debugmode.php@ line 41 |
1 | A debug message, SQL statement, or other useful Debugging information would appear here |
ridgestar\ExampleFunction from /home/ridgestar/rsr/www/debugmode.php@ line 29 |
To see this in action, click to Locations and watch the SQL results...
Restricting Debug Output
You're also likely to notice that debug mode can produce a LOT of output at times. You can restrict the Debug output to only that which matches specific situations by adding "criteria" after the debug activation by specifying a comma and then the desired character string, as in:
http://ridgestar.com/debugmode.php?debug=1,ExampleFunction
The restricted output string compares the origin location string of each output Backtrace entry and will include the output only if the specified case-sensitive character string is present in one or more of the backtrace identifiable calling points.
In this example, the Debug entry is exposed because the string "ExampleFunction" was present in the Backtrace for the testing point above and the other debug expansions at the top and bottom of this page are suppressed because they do not contain the specified string. Use of this technique can be very effective at eliminating unwanted debug results that you may not have an interest in.
Happy debugging!