* @license PHP License * @package WB * @subpackage base */ WBClass::load('WBEvent_Handler'); /** * Event_Handler_Debug * * Prints stuff on debu * * @version 0.1.0 * @package WB * @subpackage base */ class WBEvent_Handler_Debug extends WBEvent_Handler { /** * Handler Config * * @var array */ protected $config = array( 'title' => 'Debug', 'titleformat' => "
%s\n" ); /** * Process event * * @see isRecoverable() * @param WBEvent $e * @return bool true to continue, false to stop processing * @throws Exception in case of error */ public function process(WBEvent $e) { $debug = WBParam::get('wb/debug', 0); if (5 > $debug) { return true; } printf($this->config['titleformat'], $this->config['title']); printf($this->config['dataformat'], print_r($e->get(), true)); return true; } }