🎨 Log classes : PHPDoc & fix wrong self:: uses

This commit is contained in:
Pierre Goiffon
2019-10-03 14:30:13 +02:00
parent f51cd65b1f
commit 2c8887398d
2 changed files with 16 additions and 6 deletions

View File

@@ -27,6 +27,13 @@ class FileLog
{
protected $m_sFile = ''; // log is disabled if this is empty
/**
* FileLog constructor.
*
* @param string $sFileName
*
* @since 2.7.0 allow to rotate file (N°2518)
*/
public function __construct($sFileName = '')
{
$this->m_sFile = $sFileName;
@@ -34,22 +41,22 @@ class FileLog
public function Error($sText)
{
self::Write("Error | ".$sText);
$this->Write("Error | ".$sText);
}
public function Warning($sText)
{
self::Write("Warning | ".$sText);
$this->Write("Warning | ".$sText);
}
public function Info($sText)
{
self::Write("Info | ".$sText);
$this->Write("Info | ".$sText);
}
public function Ok($sText)
{
self::Write("Ok | ".$sText);
$this->Write("Ok | ".$sText);
}
protected function Write($sText)
@@ -73,6 +80,7 @@ abstract class LogAPI
{
public static function Enable($sTargetFile)
{
// m_oFileLog is not defined as a class attribute so that each impl will have its own
static::$m_oFileLog = new FileLog($sTargetFile);
}

View File

@@ -37,7 +37,8 @@ class SetupPage extends NiceWebPage
parent::__construct($sTitle);
$this->add_linked_script("../js/jquery.blockUI.js");
$this->add_linked_script("../setup/setup.js");
$this->add_style("
$this->add_style(
<<<CSS
body {
background-color: #eee;
margin: 0;
@@ -168,7 +169,8 @@ h3.clickable.open {
padding-left:16px;
cursor: hand;
}
");
CSS
);
}
/**