summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
Diffstat (limited to 'framework')
-rw-r--r--framework/Exceptions/TErrorHandler.php2
-rw-r--r--framework/Exceptions/templates/exception-en.html2
-rw-r--r--framework/Exceptions/templates/exception-fr.html2
-rw-r--r--framework/Exceptions/templates/exception-zh.html4
-rw-r--r--framework/Exceptions/templates/exception.html2
-rw-r--r--framework/Log/TLogRouter.php22
-rw-r--r--framework/TApplication.php7
7 files changed, 22 insertions, 19 deletions
diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php
index fec4ce00..682de231 100644
--- a/framework/Exceptions/TErrorHandler.php
+++ b/framework/Exceptions/TErrorHandler.php
@@ -135,7 +135,7 @@ class TErrorHandler extends TModule
else
$this->handleExternalError(500,$param);
}
- exit(1);
+// exit(1);
}
/**
diff --git a/framework/Exceptions/templates/exception-en.html b/framework/Exceptions/templates/exception-en.html
index c087792f..f9012206 100644
--- a/framework/Exceptions/templates/exception-en.html
+++ b/framework/Exceptions/templates/exception-en.html
@@ -12,7 +12,7 @@ h1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
h2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
h3 {font-family:"Verdana";font-weight:bold;font-size:11pt}
p {font-family:"Verdana";font-weight:normal;color:black;font-size:9pt;margin-top: -5px}
-code,pre {font-family:"Lucida Console";}
+code,pre {font-family:"Lucida Console";font-size:10pt;}
td,.version {color: gray;font-size:8pt;border-top:1px solid #aaaaaa;}
.source {font-family:"Lucida Console";font-weight:normal;background-color:#ffffee;}
.error {background-color: #ffeeee;}/*]]>*/
diff --git a/framework/Exceptions/templates/exception-fr.html b/framework/Exceptions/templates/exception-fr.html
index ee41571c..993ef39e 100644
--- a/framework/Exceptions/templates/exception-fr.html
+++ b/framework/Exceptions/templates/exception-fr.html
@@ -11,7 +11,7 @@ h1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
h2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
h3 {font-family:"Verdana";font-weight:bold;font-size:11pt}
p {font-family:"Verdana";font-weight:normal;color:black;font-size:9pt;margin-top: -5px}
-code,pre {font-family:"Lucida Console";}
+code,pre {font-family:"Lucida Console";font-size:10pt;}
td,.version {color: gray;font-size:8pt;border-top:1px solid #aaaaaa;}
.source {font-family:"Lucida Console";font-weight:normal;background-color:#ffffee;}
.error {background-color: #ffeeee;}
diff --git a/framework/Exceptions/templates/exception-zh.html b/framework/Exceptions/templates/exception-zh.html
index e4c8cbcc..ddfe9473 100644
--- a/framework/Exceptions/templates/exception-zh.html
+++ b/framework/Exceptions/templates/exception-zh.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC
+<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh" lang="zh">
@@ -12,7 +12,7 @@ h1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
h2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
h3 {font-family:"Verdana";font-weight:bold;font-size:11pt}
p {font-family:"Verdana";font-weight:normal;color:black;font-size:9pt;margin-top: -5px}
-code,pre {font-family:"Lucida Console";}
+code,pre {font-family:"Lucida Console";font-size:10pt;}
td,.version {color: gray;font-size:8pt;border-top:1px solid #aaaaaa;}
.source {font-family:"Lucida Console";font-weight:normal;background-color:#ffffee;}
.error {background-color: #ffeeee;}
diff --git a/framework/Exceptions/templates/exception.html b/framework/Exceptions/templates/exception.html
index c087792f..f9012206 100644
--- a/framework/Exceptions/templates/exception.html
+++ b/framework/Exceptions/templates/exception.html
@@ -12,7 +12,7 @@ h1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
h2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
h3 {font-family:"Verdana";font-weight:bold;font-size:11pt}
p {font-family:"Verdana";font-weight:normal;color:black;font-size:9pt;margin-top: -5px}
-code,pre {font-family:"Lucida Console";}
+code,pre {font-family:"Lucida Console";font-size:10pt;}
td,.version {color: gray;font-size:8pt;border-top:1px solid #aaaaaa;}
.source {font-family:"Lucida Console";font-weight:normal;background-color:#ffffee;}
.error {background-color: #ffeeee;}/*]]>*/
diff --git a/framework/Log/TLogRouter.php b/framework/Log/TLogRouter.php
index 3292c4d3..ef16cb67 100644
--- a/framework/Log/TLogRouter.php
+++ b/framework/Log/TLogRouter.php
@@ -68,7 +68,7 @@ class TLogRouter extends TModule
throw new TConfigurationException('logrouter_configfile_invalid',$this->_configFile);
}
$this->loadConfig($config);
- //$this->getApplication()->attachEventHandler('OnError',array($this,'collectLogs'));
+ $this->getApplication()->attachEventHandler('OnError',array($this,'collectLogs'));
$this->getApplication()->attachEventHandler('OnEndRequest',array($this,'collectLogs'));
}
@@ -158,6 +158,7 @@ abstract class TLogRoute extends TComponent
TLogger::INFO=>'Info',
TLogger::NOTICE=>'Notice',
TLogger::WARNING=>'Warning',
+ TLogger::ERROR=>'Error',
TLogger::ALERT=>'Alert',
TLogger::FATAL=>'Fatal'
);
@@ -169,6 +170,7 @@ abstract class TLogRoute extends TComponent
'info'=>TLogger::INFO,
'notice'=>TLogger::NOTICE,
'warning'=>TLogger::WARNING,
+ 'error'=>TLogger::ERROR,
'alert'=>TLogger::ALERT,
'fatal'=>TLogger::FATAL
);
@@ -200,7 +202,7 @@ abstract class TLogRoute extends TComponent
/**
* @param integer|string integer log level filter (in bits). If the value is
* a string, it is assumed to be comma-separated level names. Valid level names
- * include 'Error', 'Debug', 'Info', 'Notice', 'Warning', 'Error', 'Alert' and 'Fatal'.
+ * include 'Debug', 'Info', 'Notice', 'Warning', 'Error', 'Alert' and 'Fatal'.
*/
public function setLevels($levels)
{
@@ -604,10 +606,11 @@ class TBrowserLogRoute extends TLogRoute
$string = <<<EOD
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
- <th style="background-color: black; color:white;" colspan="10">
+ <th style="background-color: black; color:white;" colspan="11">
<h3>Trace Information: $category</h3>
</th>
</tr><tr style="background-color: #ccc;">
+ <th>&nbsp;</th>
<th>Category</th><th>Message</th><th>From First(s)</th><th>From Last(s)</th>
</tr>
EOD;
@@ -622,8 +625,8 @@ EOD;
$color = $this->getColorLevel($log[1]);
$msg = preg_replace('/\(line[^\)]+\)$/','',$log[0]); //remove line number info
$string = <<<EOD
- <tr style="background-color: {$bgcolor}; color: {$color}">
- <td>{$log[2]}</td><td>{$msg}</td><td>{$total}</td><td>{$delta}</td>
+ <tr style="background-color: {$bgcolor};">
+ <td style="background-color: $color;">&nbsp;</td><td>{$log[2]}</td><td>{$msg}</td><td>{$total}</td><td>{$delta}</td>
</tr>
EOD;
return $string;
@@ -635,16 +638,17 @@ EOD;
{
case TLogger::DEBUG: return 'green';
case TLogger::INFO: return 'black';
- case TLogger::NOTICE: return 'blue';
- case TLogger::WARNING: return '#f63';
- case TLogger::ALERT: return '#c00';
+ case TLogger::NOTICE: return '#3333FF';
+ case TLogger::WARNING: return '#33FFFF';
+ case TLogger::ERROR: return '#ff9933';
+ case TLogger::ALERT: return '#ff00ff';
case TLogger::FATAL: return 'red';
}
}
protected function renderFooter()
{
- $string = "<tr><td colspan=\"10\" style=\"text-align:center; border-top: 1px solid #ccc; padding:0.2em;\">";
+ $string = "<tr><td colspan=\"11\" style=\"text-align:center; border-top: 1px solid #ccc; padding:0.2em;\">";
foreach(self::$_levelValues as $name => $level)
{
$string .= "<span style=\"color:".$this->getColorLevel($level);
diff --git a/framework/TApplication.php b/framework/TApplication.php
index 80c55e44..5f5c519c 100644
--- a/framework/TApplication.php
+++ b/framework/TApplication.php
@@ -803,10 +803,9 @@ class TApplication extends TComponent
*/
public function onError($param)
{
- if($this->hasEventHandler('OnError'))
- $this->raiseEvent('OnError',$this,$param);
- else
- $this->getErrorHandler()->handleError($this,$param);
+ Prado::log($param->getMessage(),TLogger::ERROR,'System.TApplication');
+ $this->getErrorHandler()->handleError($this,$param);
+ $this->raiseEvent('OnError',$this,$param);
}
/**