Source for file PlainTextDebugHandlerPrinter.class.php

Documentation is available at PlainTextDebugHandlerPrinter.class.php

  1. <?php
  2.  
  3. require_once(HARMONI."debugHandler/DebugHandlerPrinter.interface.php");
  4.  
  5. /**
  6. * the PlainTextDebugHandlerPrinter prints debug items right to stdout
  7. *
  8. * @package harmoni.utilities.debugging
  9. *
  10. * @copyright Copyright &copy; 2005, Middlebury College
  11. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  12. *
  13. * @version $Id: PlainTextDebugHandlerPrinter.class.php,v 1.5 2007/09/04 20:25:33 adamfranco Exp $
  14. ***/
  15.  
  16. class PlainTextDebugHandlerPrinter extends DebugHandlerPrinterInterface {
  17. /**
  18. * Outputs the DebugItems in $debugHandler.
  19. *
  20. * @param object DebugHandler $debugHandler The DebugHandler object to output.
  21. * @param int $level The level to output. All output < $level will be displayed. Default = user Handler's internal output level.
  22. * @param optional string $category Limit output to only items under $category.
  23. * @access public
  24. * @return void
  25. ***/
  26. function printDebugHandler( $debugHandler, $level = null, $category = "" ) {
  27. if ($level == null) $level = $debugHandler->getOutputLevel();
  28. print "Printing all debug output for $level and category '$category'\n\n";
  29. $items = $debugHandler->getDebugItems($category);
  30. if ($level == 0) return true;
  31. print "\n<pre>\n";
  32. foreach (array_keys($items) as $key) {
  33. if ($items[$key]->getLevel() <= $level)
  34. print "[".$items[$key]->getCategory().":".$items[$key]->getLevel()."] ".$items[$key]->getText()."\n";
  35. }
  36. print "\n</pre>\n";
  37. }
  38. }
  39.  
  40. ?>

Documentation generated on Wed, 19 Sep 2007 10:25:30 -0400 by phpDocumentor 1.3.0RC3