Simplify Logger

This commit is contained in:
djmaze 2021-11-19 11:08:43 +01:00
parent c78be97787
commit 7b600bc77a
2 changed files with 8 additions and 5 deletions

View file

@ -15,7 +15,7 @@ namespace MailSo\Log;
* @category MailSo * @category MailSo
* @package Log * @package Log
*/ */
class Logger extends \MailSo\Base\Collection class Logger extends \SplFixedArray
{ {
private $bUsed = false; private $bUsed = false;
@ -81,14 +81,17 @@ class Logger extends \MailSo\Base\Collection
return $sCache; return $sCache;
} }
public function Ping() : bool public function append($oDriver) : void
{ {
return true; if ($oDriver) {
$this->setSize(1);
$this[0] = $oDriver;
}
} }
public function IsEnabled() : bool public function IsEnabled() : bool
{ {
return 0 < $this->Count(); return 0 < $this->count();
} }
public function AddSecret(string $sWord) : void public function AddSecret(string $sWord) : void

View file

@ -152,7 +152,7 @@ class Actions
$oConfig = $this->Config(); $oConfig = $this->Config();
$this->Plugins()->RunHook('filter.application-config', array($oConfig)); $this->Plugins()->RunHook('filter.application-config', array($oConfig));
$this->Logger()->Ping(); $this->Logger();
} }
public function SetIsJson(bool $bIsJson): self public function SetIsJson(bool $bIsJson): self