View Single Post
Old 04-15-2009, 02:07 AM   #11 (permalink)
Kalle
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

I would rather use a set of procedural functions for debugging than a class, instead of making a class where almost all methods are better served static (from my point of view).

All you need is a set of functions thats usable for debugging, and only included when debug mode is triggered (if your system ofcourse have a debugging mode).

Example of functions can be:
  • Backtracing in a nice manner thats more detailed that the regular debug_print_backtrace() output
  • Functions for catching and displaying exceptions and errors in somewhat unified interface, combining this with the backtrace is a good idea, as it can show if anywhere in the backtrace something occured
  • Assertions, http://www.php.net/assert
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
The Following User Says Thank You to Kalle For This Useful Post:
Orc (04-17-2009)