<?php
/**
* SVF_Controller_Plugin_Log_Firebug
*
* LICENSE
*
* This source file is subject to the BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://svf.webutilities.ch/license/bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to hide@address.com so we can send you a copy immediately.
*
* @package SVF
* @category Controller
* @subpackage Controller
* @uses Zend_Controller_Plugin_Abstract
* @uses Zend_Controller_Request_Abstract
* @uses SVF_Log
* @copyright Copyright (c) 2002-2008 Webutilities CH Inc. (http://www.webutilities.ch)
* @license BSD {@link http://svf.webutilities.ch/license/bsd}
* @author Silvan von Felten
* @version $Id$
*/
require_once 'Zend/Controller/Plugin/Abstract.php';
require_once 'Zend/Controller/Request/Abstract.php';
class SVF_Controller_Plugin_Log_Firebug extends Zend_Controller_Plugin_Abstract
{
/**
* Instance
*
* @var Zend_Controller_Request_Abstract
*/
protected $_request;
/**
* Route Startup handler
*
* @param Zend_Controller_Request_Abstract $request
* @return void
*/
public function routeStartup(Zend_Controller_Request_Abstract $request)
{
$this->_request = $request;
$this->initLog();
}
/**
* Initialize firebug logger
*
* @return SVF_Plugin_Initialize
*/
public function initLog()
{
defined('SVF_LOG_TABLE') or
define('SVF_LOG_TABLE', true);
require_once 'SVF/Log.php';
$log = new SVF_Log;
// Add prioritys to the logger
$log->addPrioritys(array('TABLE' => 8));
// Add firebug logger
$log->addFirebug();
// Get the firebug writer and set the a priority style
$log->getWriterFirebug()->setPriorityStyle(8, 'TABLE');
// Set the logger to the registry
Zend_Registry::set('log', $log);
return $this;
}
}