logger.class.php 573 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. use Nekonomokochan\PhpJsonLogger\LoggerBuilder;
  3. class OrganizrLogger extends LoggerBuilder
  4. {
  5. public $isReady;
  6. /**
  7. * @return boolean
  8. */
  9. public function getReadyStatus(): bool
  10. {
  11. return $this->isReady;
  12. }
  13. /**
  14. * @param boolean $readyStatus
  15. */
  16. public function setReadyStatus(bool $readyStatus)
  17. {
  18. $this->isReady = $readyStatus;
  19. }
  20. public function build(): OrganizrLoggerExt
  21. {
  22. if (!$this->isReady) {
  23. $this->setChannel('Organizr');
  24. $this->setLogLevel(self::DEBUG);
  25. $this->setMaxFiles(1);
  26. }
  27. return new OrganizrLoggerExt($this);
  28. }
  29. }