diff options
author | knut <> | 2008-08-14 10:16:47 +0000 |
---|---|---|
committer | knut <> | 2008-08-14 10:16:47 +0000 |
commit | 13b1a1322567521e4ba7a51d2f11aa5b4c24a3b6 (patch) | |
tree | bd460102f678c6b727ea2f357ffb9d899f9322aa /framework/Util | |
parent | 9b940a6b86bf661eb66ad5752ecde1ec7a6358a8 (diff) |
fixed #908
Diffstat (limited to 'framework/Util')
-rw-r--r-- | framework/Util/TLogRouter.php | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/framework/Util/TLogRouter.php b/framework/Util/TLogRouter.php index 90f19534..5c755985 100644 --- a/framework/Util/TLogRouter.php +++ b/framework/Util/TLogRouter.php @@ -4,7 +4,7 @@ *
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Util
@@ -757,7 +757,7 @@ class TDbLogRoute extends TLogRoute if($this->_autoCreate)
$this->createDbTable();
else
- throw TConfigurationException('db_logtable_inexistent',$this->_logTable);
+ throw new TConfigurationException('db_logtable_inexistent',$this->_logTable);
}
parent::init($config);
@@ -891,79 +891,79 @@ class TDbLogRoute extends TLogRoute }
}
- -/** - * TFirebugLogRoute class. - * - * TFirebugLogRoute prints selected log messages in the firebug log console. - * - * {@link http://www.getfirebug.com/ FireBug Website} - * - * @author Enrico Stahn <mail@enricostahn.com>, Christophe Boulain <Christophe.Boulain@gmail.com> - * @version $Id$ - * @package System.Util - * @since 3.1.2 - */ -class TFirebugLogRoute extends TBrowserLogRoute -{ - protected function renderHeader () - { - $string = <<<EOD - -<script type="text/javascript"> -/*<![CDATA[*/ -if (typeof(console) == 'object') -{ - console.log ("[Cumulated Time] [Time] [Level] [Category] [Message]"); - -EOD; - - return $string; - } - - protected function renderMessage ($log, $info) - { - $logfunc = $this->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 - -} -</script> - -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'; - } - return 'console.log'; - } - +
+/**
+ * TFirebugLogRoute class.
+ *
+ * TFirebugLogRoute prints selected log messages in the firebug log console.
+ *
+ * {@link http://www.getfirebug.com/ FireBug Website}
+ *
+ * @author Enrico Stahn <mail@enricostahn.com>, Christophe Boulain <Christophe.Boulain@gmail.com>
+ * @version $Id$
+ * @package System.Util
+ * @since 3.1.2
+ */
+class TFirebugLogRoute extends TBrowserLogRoute
+{
+ protected function renderHeader ()
+ {
+ $string = <<<EOD
+
+<script type="text/javascript">
+/*<![CDATA[*/
+if (typeof(console) == 'object')
+{
+ console.log ("[Cumulated Time] [Time] [Level] [Category] [Message]");
+
+EOD;
+
+ return $string;
+ }
+
+ protected function renderMessage ($log, $info)
+ {
+ $logfunc = $this->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
+
+}
+</script>
+
+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';
+ }
+ return 'console.log';
+ }
+
}
-?> +?>
|