Simplifie le code de log des erreurs

This commit is contained in:
Alan Garcia 2014-01-21 08:35:57 +00:00
parent efc0e5881b
commit d83474112f
1 changed files with 2 additions and 17 deletions

View File

@ -117,13 +117,7 @@ class m_err {
*/
function logerr() {
global $mem;
$f=@fopen($this->logfile,"ab");
if ($f) {
fputs($f,date("d/m/Y H:i:s")." - ERROR - ");
fputs($f,$mem->user["login"]." - ");
fputs($f,$this->errstr());
fclose($f);
}
@file_put_contents($this->logfile, date("d/m/Y H:i:s")." - ERROR - ".$mem->user["login"]." - ".$this->errstr(), FILE_APPEND );
}
/**
@ -140,16 +134,7 @@ class m_err {
*/
function log($clsid,$function,$param="") {
global $mem,$cuid;
$f=@fopen($this->logfile,"ab");
if ($f) {
fputs($f,date("d/m/Y H:i:s")." - " .get_remote_ip(). " - CALL - ");
fputs($f,$mem->user["login"]." - ");
fputs($f,$clsid." - ".$function." - ".$param."\n");
fclose($f);
return true;
} else {
return false;
}
return @file_put_contents($this->logfile,date("d/m/Y H:i:s")." - " .get_remote_ip(). " - CALL - ".$mem->user["login"]." - $clsid - $function - $param\n", FILE_APPEND );
}
}; /* Classe m_err */