| Total Complexity | 9 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Coverage | 61.53% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | final class LoggerUtil implements LoggerUtilInterface |
||
| 14 | { |
||
| 15 | private ?Logger $logger = null; |
||
| 16 | |||
| 17 | private int $level; |
||
| 18 | |||
| 19 | private bool $doLog = false; |
||
| 20 | |||
| 21 | 11 | public function __construct(private StuConfigInterface $stuConfig) {} |
|
| 22 | |||
| 23 | 2 | #[Override] |
|
| 24 | public function init(string $channel = 'stu', int $level = LoggerEnum::LEVEL_INFO): void |
||
| 25 | { |
||
| 26 | 2 | $this->level = $level; |
|
| 27 | |||
| 28 | 2 | if ($this->checkDoLog()) { |
|
| 29 | 2 | $this->logger = new Logger($channel); |
|
| 30 | 2 | $this->logger->pushHandler( |
|
| 31 | 2 | new StreamHandler( |
|
| 32 | 2 | $this->stuConfig->getDebugSettings()->getLogfilePath() |
|
| 33 | 2 | ), |
|
| 34 | 2 | ); |
|
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | 2 | private function checkDoLog(): bool |
|
| 39 | { |
||
| 40 | 2 | $threshold = $this->stuConfig->getDebugSettings()->getLoglevel(); |
|
| 41 | |||
| 42 | 2 | $this->doLog = $threshold <= $this->level; |
|
| 43 | |||
| 44 | 2 | return $this->doLog; |
|
| 45 | } |
||
| 46 | |||
| 47 | #[Override] |
||
| 51 | } |
||
| 52 | |||
| 53 | 188 | #[Override] |
|
| 63 | } |
||
| 64 | } |
||
| 65 | |||
| 66 | #[Override] |
||
| 75 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths