| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | protected function write(array $record): void { |
||
| 21 | $entry = [ |
||
| 22 | 'channel' => $record['channel'], |
||
| 23 | 'level' => $record['level'], |
||
| 24 | 'message' => $record['formatted'], |
||
| 25 | 'time' => $record['datetime'], |
||
| 26 | 'details' => json_encode($record['extra'], JSON_PRETTY_PRINT) |
||
| 27 | ]; |
||
| 28 | |||
| 29 | try { |
||
| 30 | $this->connection |
||
| 31 | ->insert('log', $entry, [ |
||
| 32 | Types::STRING, |
||
| 33 | Types::INTEGER, |
||
| 34 | Types::TEXT, |
||
| 35 | Types::DATETIME_MUTABLE, |
||
| 36 | Types::STRING |
||
| 37 | ]); |
||
| 38 | } catch (Exception) { |
||
| 39 | // Logging failed :-/ |
||
| 42 | } |