Total Complexity | 9 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Coverage | 55% |
Changes | 0 |
1 | <?php |
||
12 | final class LoggerUtil implements LoggerUtilInterface |
||
13 | { |
||
14 | private ?Logger $logger = null; |
||
15 | |||
16 | private LogLevelEnum $level; |
||
17 | |||
18 | private bool $doLog = false; |
||
19 | |||
20 | 11 | public function __construct(private StuConfigInterface $stuConfig) {} |
|
21 | |||
22 | 2 | #[Override] |
|
23 | public function init(string $channel = 'stu', LogLevelEnum $level = LogLevelEnum::INFO): void |
||
24 | { |
||
25 | 2 | $this->level = $level; |
|
26 | |||
27 | 2 | if ($this->checkDoLog()) { |
|
28 | 2 | $this->logger = StuLogger::getLogger(LogTypeEnum::DEFAULT); |
|
29 | } |
||
30 | } |
||
31 | |||
32 | 2 | private function checkDoLog(): bool |
|
33 | { |
||
34 | 2 | $threshold = $this->stuConfig->getDebugSettings()->getLoglevel(); |
|
35 | |||
36 | 2 | $this->doLog = $threshold <= $this->level->value; |
|
37 | |||
38 | 2 | return $this->doLog; |
|
39 | } |
||
40 | |||
41 | #[Override] |
||
45 | } |
||
46 | |||
47 | 8 | #[Override] |
|
56 | } |
||
57 | } |
||
58 | |||
59 | #[Override] |
||
68 |
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