| Total Complexity | 4 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | final class PirateLogger implements PirateLoggerInterface |
||
| 12 | { |
||
| 13 | private ?Logger $logger = null; |
||
| 14 | |||
| 15 | public function __construct(private StuConfigInterface $stuConfig) |
||
| 16 | { |
||
| 17 | } |
||
| 18 | |||
| 19 | public function initRotating(): void |
||
| 20 | { |
||
| 21 | $this->logger = new Logger('KAZON'); |
||
| 22 | $this->logger->pushHandler( |
||
| 23 | new RotatingFileHandler( |
||
| 24 | $this->stuConfig->getGameSettings()->getPirateLogfilePath() |
||
| 25 | ), |
||
| 26 | ); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function log(string $message): void |
||
| 30 | { |
||
| 31 | $method = LoggerEnum::LEVEL_METHODS[LoggerEnum::LEVEL_INFO]; |
||
| 32 | $this->logger->$method($message); |
||
| 33 | } |
||
| 34 | |||
| 35 | public function logf(string $information, ...$args): void |
||
| 40 | )); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |