* @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2014 PradoSoft * @license http://www.pradosoft.com/license/ * @package Prado\Util */ namespace Prado\Util; /** * TFirebugLogRoute class. * * TFirebugLogRoute prints selected log messages in the firebug log console. * * {@link http://www.getfirebug.com/ FireBug Website} * * @author Enrico Stahn , Christophe Boulain * @package Prado\Util * @since 3.1.2 */ class TFirebugLogRoute extends TBrowserLogRoute { protected function renderHeader () { $string = << /*getFirebugLoggingFunction($log[1]); $total = sprintf('%0.6f', $info['total']); $delta = sprintf('%0.6f', $info['delta']); $msg = trim($this->formatLogMessage($log[0], $log[1], $log[2], '')); $msg = preg_replace('/\(line[^\)]+\)$/', '', $msg); //remove line number info $msg = "[{$total}] [{$delta}] ".$msg; // Add time spent and cumulated time spent $string = $logfunc . '(\'' . addslashes($msg) . '\');' . "\n"; return $string; } protected function renderFooter () { $string = << EOD; return $string; } protected function getFirebugLoggingFunction($level) { switch ($level) { case TLogger::DEBUG: case TLogger::INFO: case TLogger::NOTICE: return 'console.log'; case TLogger::WARNING: return 'console.warn'; case TLogger::ERROR: case TLogger::ALERT: case TLogger::FATAL: return 'console.error'; default: return 'console.log'; } } }