formatting

This commit is contained in:
Miles Lott 2001-09-23 19:33:39 +00:00
parent cc3247e481
commit 0d1dcab48d
2 changed files with 12 additions and 16 deletions

View File

@ -37,7 +37,6 @@
function error($parms)
{
global $phpgw;
if ($parms == '')
{
return;
@ -61,17 +60,17 @@
$this->ismsg = $parms['ismsg'];
$this->fname = $fname;
$this->line = $line;
$this->app = $phpgw_info['flags']['currentapp'];
$this->app = $GLOBALS['phpgw_info']['flags']['currentapp'];
if (!$this->fname or !$this->line)
{
$phpgw->log->error(array(
$GLOBALS['phpgw']->log->error(array(
'text'=>'W-PGMERR, Programmer failed to pass __FILE__ and/or __LINE__ in next log message',
'file'=>__FILE__,'line'=>__LINE__
));
}
$phpgw->log->errorstack[] = $this;
$GLOBALS['phpgw']->log->errorstack[] = $this;
if ($this->severity == 'F')
{
// This is it... Don't return
@ -81,11 +80,11 @@
echo "<Center>";
echo "<h1>Fatal Error</h1>";
echo "<h2>Error Stack</h2>";
echo $phpgw->log->astable();
echo $GLOBALS['phpgw']->log->astable();
echo "</center>";
// Commit stack to log
$phpgw->log->commit();
$phpgw->common->phpgw_exit(True);
$GLOBALS['phpgw']->log->commit();
$GLOBALS['phpgw']->common->phpgw_exit(True);
}
}
}

View File

@ -104,14 +104,13 @@
function commit()
{
global $phpgw, $phpgw_info;
$db = $phpgw->db;
$db = $GLOBALS['phpgw']->db;
// $db->lock('phpgw_log');
$db->query ("insert into phpgw_log (log_date, log_user, log_app, log_severity) values "
."('". $phpgw->db->to_timestamp(time()
."('". $GLOBALS['phpgw']->db->to_timestamp(time()
)
."','".$phpgw->session->account_id
."','".$phpgw_info['flags']['currentapp']."'"
."','".$GLOBALS['phpgw']->session->account_id
."','".$GLOBALS['phpgw_info']['flags']['currentapp']."'"
.",'".$this->severity()."'"
.")"
,__LINE__,__FILE__);
@ -131,7 +130,7 @@
."log_msg_code, log_msg_msg, log_msg_parms, log_msg_file, log_msg_line) values "
."(" . $log_id
."," . $i
.", '" . $phpgw->db->to_timestamp($err->timestamp
.", '" . $GLOBALS['phpgw']->db->to_timestamp($err->timestamp
)
."', '". $err->severity . "'"
.", '". $err->code . "'"
@ -167,8 +166,6 @@
function astable()
{
global $phpgw;
$html = "<center>\n";
$html .= "<table width=\"98%\">\n";
$html .= "\t<tr bgcolor=\"D3DCFF\">\n";
@ -197,7 +194,7 @@
$html .= "\t<tr bgcolor=".'"'.$color.'"'.">\n";
$html .= "\t\t<td align=center>".$i."</td>\n";
$html .= "\t\t<td>".$phpgw->common->show_date($err->timestamp)."</td>\n";
$html .= "\t\t<td>".$GLOBALS['phpgw']->common->show_date($err->timestamp)."</td>\n";
$html .= "\t\t<td>".$err->app."&nbsp </td>\n";
$html .= "\t\t<td align=center>".$err->severity."</td>\n";
$html .= "\t\t<td>".$err->code."</td>\n";