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.
In the code, use the following:
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 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.