| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 | } |
||
| 47 |