mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Removed unnecessary header from log when using append mode.
This commit is contained in:
@@ -647,12 +647,10 @@ class e_admin_log
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = "";
|
|
||||||
|
|
||||||
if(count($this->_allMessages))
|
if(count($this->_allMessages))
|
||||||
{
|
{
|
||||||
$text .= " e107 CMS Log file : ".$logTitle." ".date('Y-m-d_H-i-s')."\n";
|
$head = " e107 CMS Log file : ".$logTitle." ".date('Y-m-d_H-i-s')."\n";
|
||||||
$text .= "-------------------------------------------------------------------------------------------\n\n";
|
$head .= "-------------------------------------------------------------------------------------------\n\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -661,7 +659,7 @@ class e_admin_log
|
|||||||
|
|
||||||
foreach($this->_allMessages as $m)
|
foreach($this->_allMessages as $m)
|
||||||
{
|
{
|
||||||
$text .= date('Y-m-d H:i:s',$m['time'])." \t".str_pad($m['dislevel'],10," ",STR_PAD_RIGHT)."\t".strip_tags($m['message'])."\n";
|
$text .= date('Y-m-d H:i:s', $m['time'])." \t".str_pad($m['dislevel'],10," ",STR_PAD_RIGHT)."\t".strip_tags($m['message'])."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$date = ($append == true) ? date('Y-m-d') : date('Y-m-d_H-i-s').'_'.crc32($text);
|
$date = ($append == true) ? date('Y-m-d') : date('Y-m-d_H-i-s').'_'.crc32($text);
|
||||||
@@ -671,10 +669,15 @@ class e_admin_log
|
|||||||
if($append == true)
|
if($append == true)
|
||||||
{
|
{
|
||||||
$app = FILE_APPEND;
|
$app = FILE_APPEND;
|
||||||
|
if(!file_exists($fileName))
|
||||||
|
{
|
||||||
|
$text = $head . $text;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$app = null;
|
$app = null;
|
||||||
|
$text = $head . $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(file_put_contents($fileName, $text, $app))
|
if(file_put_contents($fileName, $text, $app))
|
||||||
|
Reference in New Issue
Block a user