Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function log($logLevel, $message, array $context = []) |
||
22 | { |
||
23 | $consoleFunctionMap = [ |
||
24 | 'emergency' => 'error', |
||
25 | 'alert' => 'warn', |
||
26 | 'critical' => 'error', |
||
27 | 'error' => 'error', |
||
28 | 'warning' => 'warn', |
||
29 | 'notice' => 'log', |
||
30 | 'info' => 'info', |
||
31 | 'debug' => 'debug', |
||
32 | ]; |
||
33 | $message = $this->formatMessage($message, $logLevel, $context); |
||
34 | echo "<script>"; |
||
35 | echo sprintf("console.%s('%s');", $consoleFunctionMap[$logLevel], $message); |
||
36 | echo "</script>"; |
||
37 | } |
||
61 |