Forums / Cotonti / Core Labs / Archive / Debugging facilities

Some improvements to make life easier

Trustmaster
#11887 2009-04-29 12:25
That MySQL puzzle is solved by adding backtrace to sed_diefatal(). Any more wishes?

OK, I've added a few simple functions which make manual debugging easier:
  • sed_assert($var1,..) - use it to print variables on a blank screen immediately
  • sed_backtrace() - prints backtrace (files, functions, parameters). By default blanks the screen, call sed_backtrace(FALSE) to see backtrace within normal output flow.
  • sed_vardump() - attempts to print contents of all global variables recursively. Doesn't print all of them because it has length limitation. By default blanks the screen, call sed_vardump(FALSE) to see vardump within normal output flow.

sed_diefatal() was modified and a new option was added to config.php:
/**
 * Defines whether to display debugging information on critical errors.
 * Comment it on production sites if you wish.
 */
define('SED_DEBUG', TRUE);
By default this switch is on. On some production sites you'd like to disable it because debug info contains file paths. When this switch is defined, sed_diefatal() prints backtrace. It is extremely useful to track MySQL errors.
May the Source be with you!
This post was edited by Trustmaster (2009-05-03 17:41, 14 years ago)