Total Complexity | 4 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | trait LogTrait |
||
11 | { |
||
12 | protected \WebServCo\Framework\Interfaces\LoggerInterface $fileLogger; |
||
13 | protected \WebServCo\Framework\Interfaces\OutputLoggerInterface $outputLogger; |
||
14 | |||
15 | /** |
||
16 | * @param mixed $context |
||
17 | */ |
||
18 | protected function logDebug(string $message, $context = []): void |
||
19 | { |
||
20 | $this->outputLogger->debug($message); |
||
21 | $this->fileLogger->debug($message, $context); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @param mixed $context |
||
26 | */ |
||
27 | protected function logError(string $message, $context = []): void |
||
28 | { |
||
29 | $this->outputLogger->output($message); |
||
30 | |||
31 | $this->fileLogger->error($message, $context); |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @param mixed $context |
||
36 | */ |
||
37 | protected function logInfo(string $message, $context = []): void |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param mixed $context |
||
45 | */ |
||
46 | protected function logWarning(string $message, $context = []): void |
||
50 | } |
||
51 | } |
||
52 |