This is an old revision of the document!
This page is still a work in progress, it is more a place we put up a bunch of info pulled from old internal documentation. It still needs to be organized into a more usable format, until then just bear with us.
These are instructions for using the Show Debug Messages addon to display debug messages.
This is a list of the most commonly used or useful debug types.
When the above is turned on the software will display lines of output beyond the bottom of each page loaded. To see it once debug display has been turned on you only need to scroll down the page to see it. There could be quite a lot of it so if you know the type of message you are looking for you can choose it from the above list to narrow the output down a bit. The output will look something like that below though the color may change from page load to page load:
Within that output you'll notice:
Note that the software doesn't "output debug" for EVERYTHING the software does. So if you see a jump in time there just may not be much debug output in the particular section of code. We try not to put output in the middle of a loop that will iterate hundreds of times producing hundreds of lines of mainly useless output.
If you want to edit the base php code and insert your own debug output for your own feature creation or debugging use the folllowing in creating those debug triggers :
Debug message : just a general message.
trigger_error('DEBUG TYPE_1 TYPE_2: Insert debug message here.');
Error message : if something is wrong, for instance an SQL query error.
trigger_error('ERROR TYPE_1 TYPE_2: Insert error message here.');
Explanation of parts:
DEBUG or ERROR: First word in message needs to be either DEBUG or ERROR, depending on if this is just a general message or if it is reporting something that has gone wrong.
Debug types: AKA debug "keywords": A list of "debug types" this message applied so, separated by spaces, all upper case. Must be A-Z and underscore "_" any other characters can cause the message to not be handled as a Geo debug message.
: After the list of debug types, is a colon ":" which signifies the start of the actual debug message.
Message: Everything after the first colon ":" is treated as the debug message.
Future debug types: If you want to create a special debug type (so that it can get its own color or whatever) all you have to do is start using a unique type, like YOUR_UNIQUE_TYPE, then in the URL (if using show debug messages addon) put debug=your_unique_type to see that message.
The thing about addons is that things are not initialized until that functionality is actually used. This can be a problem if you are trying to get debug messages to be logged on a page where no core events are ever triggered. Now consider that the errorhandle core event1) is never "fired" until AFTER the addons are initialized, in order to prevent a chicken and egg type of scenario. Combine these 2 facts, and that means that any page load when there is no core events fired for the entire page load, none of the debug messages will ever get sent through the errorhandle core event.
If you think this might be happening, the "fix" is to force a core event to be triggered on every page load. To do so, in app_top.common.php near the bottom, add (or un-comment if in Geo version 4.1.*):
/** * If experiencing a problem where addons are not being called for error * handling, un-comment the following line to "force" a triggered event, which * will force addons to be loaded, and thus allow error handle core events * to be called on page loads that never trigger an addon even otherwise. */ geoAddon::triggerUpdate('forceInit');
The most common places you might need this are when processing a "signal" from a payment gateway, in calls to either of the transaction_process.php or the recurring_process.php files. It could also happen in any other type of "minimal" page load such as AJAX calls and the like.
The idea behind having addons doing error handling, is that we can easily create a new addon that (for instance) only displays SQL errors, or only displays debug messages, etc. Or the addon can do different things with the information, for instance one addon could display the debug messages on the page, another could log them to a file (Debug Logger Addon), and another could e-mail the messages. If there are no addons that use errorhandle, then the performance hit for using trigger_error is insignificant.