This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
developers:debug_messages:start [2009/06/05 18:39] jonyo |
developers:debug_messages:start [2015/05/06 22:40] (current) geojames [List of Common Debug Types] |
||
---|---|---|---|
Line 11: | Line 11: | ||
- When you are done, be sure to disable the debug addon, as any debugging addon will add a small amount of overhead to each page load. | - When you are done, be sure to disable the debug addon, as any debugging addon will add a small amount of overhead to each page load. | ||
- | ===== List of Common Debug Types ===== | + | ==== List of Common Debug Types ==== |
This is a list of the most commonly used or useful debug types. | This is a list of the most commonly used or useful debug types. | ||
- | * **all** - // | + | * **all+stats** - // |
* **stats** - Most common & useful type, it shows statistic geared messages. | * **stats** - Most common & useful type, it shows statistic geared messages. | ||
* **sql** - show sql messages and errors. | * **sql** - show sql messages and errors. | ||
Line 23: | Line 23: | ||
* **index** - show output from index page. (possibly not used much) | * **index** - show output from index page. (possibly not used much) | ||
* **cache** - messages relating to cache. | * **cache** - messages relating to cache. | ||
+ | |||
+ | ===== Debug Output in the Page ===== | ||
+ | |||
+ | When the above is turned on the software will display lines of output beyond the bottom of each page loaded. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Within that output you'll notice: | ||
+ | - This is the timestamp for that line. That is the time in microseconds from the beginning of that page load to that point in the script run time. This number will only grow as you go down the page until you get to the end of the output. This is a good way to see the full amount of time the software takes to build the page requested. | ||
+ | - This the memory used by the script up to that point in the page load. This value may go up AND down in processing. | ||
+ | - This is the output displayed by coding. | ||
+ | - This is the file the output was generated from. | ||
+ | - This is the line number that output was generated from. Note that this value may not be the EXACT line as files include files and code from different sources and line counts may not be accurate. | ||
+ | |||
+ | |||
+ | Note that the software doesn' | ||
+ | |||
===== Debug Message Syntax ===== | ===== Debug Message Syntax ===== | ||
- | In the code, use the following: | + | If you want to edit the base php code and insert your own debug output for your own feature creation or debugging |
**Debug message** : just a general message. | **Debug message** : just a general message. | ||
Line 46: | Line 63: | ||
**Future debug types:** | **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, | 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, | ||
+ | |||
+ | ===== Troubleshooting ===== | ||
+ | |||
+ | 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. | ||
+ | |||
+ | If you think this might be happening, the " | ||
+ | <code php>/** | ||
+ | * If experiencing a problem where addons are not being called for error | ||
+ | * handling, un-comment the following line to " | ||
+ | * 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:: | ||
+ | |||
+ | The most common places you might need this are when processing a " | ||
===== Design Ideas ===== | ===== Design Ideas ===== | ||
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, | 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, |