| Total Complexity | 6 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | abstract class AbstractFileLogger extends AbstractLogger implements \WebServCo\Framework\Interfaces\FileLoggerInterface |
||
| 10 | { |
||
| 11 | protected string $channel; |
||
| 12 | protected string $logDir; |
||
| 13 | protected string $logPath; |
||
| 14 | |||
| 15 | public function __construct(string $channel, string $logDir) |
||
| 16 | { |
||
| 17 | $this->channel = $channel; |
||
| 18 | $this->logDir = $logDir; |
||
| 19 | |||
| 20 | if (!$this->logDir) { |
||
| 21 | throw new LoggerException(\sprintf('Log directory not set for channel "%s".', $channel)); |
||
| 22 | } |
||
| 23 | |||
| 24 | if (!\is_writable($this->logDir)) { |
||
| 25 | throw new LoggerException(\sprintf('Log directory not writeable: %s.', $this->logDir)); |
||
| 26 | } |
||
| 27 | $this->logPath = \sprintf('%s%s.log', $this->logDir, $this->channel); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function clear(): bool |
||
| 33 | } |
||
| 34 | |||
| 35 | public function getLastLine(): int |
||
| 40 | } |
||
| 41 | |||
| 42 | public function getLogDirectory(): string |
||
| 47 |