Change log file folder

This commit is contained in:
2023-08-06 13:24:00 +02:00
parent dd4469c349
commit e1cf78b992
6 changed files with 16 additions and 9 deletions

View File

@@ -12,6 +12,7 @@ class PhpObject
{
//Log file name
const LOG_FILENAME = 'log.html';
private $sLogPath;
//Message types
const NOTICE_TAB = 'Notice';
@@ -31,13 +32,14 @@ class PhpObject
private $sChildClass;
private $bDebug;
function __construct($sClass='', $bDebug=false, $iExtractMode=self::MODE_FILE)
function __construct($sClass='', $bDebug=Settings::DEBUG, $iExtractMode=self::MODE_FILE, $sLogPath='')
{
$this->asMessageStack = array();
$this->resetMessageStack();
$this->setDebug($bDebug);
$this->setExtractMode($iExtractMode);
$this->sChildClass = $sClass;
$this->setLogPath($sLogPath);
}
public function setExtractMode($iExtractMode) {
@@ -54,10 +56,15 @@ class PhpObject
{
return $this->bDebug;
}
private function setLogPath($sLogPath) {
if($sLogPath == '') $sLogPath = defined('Settings::LOG_FOLDER')?Settings::LOG_FOLDER:dirname(__FILE__);
$this->sLogPath = $sLogPath.DIRECTORY_SEPARATOR.self::LOG_FILENAME;
}
private static function getLogPath()
private function getLogPath()
{
return dirname(__FILE__).DIRECTORY_SEPARATOR.self::LOG_FILENAME;
return $this->sLogPath;
}
private function resetMessageStack($sType=self::ALL_TAB)