| Conditions | 2 |
| Paths | 2 |
| Total Lines | 26 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function format(Record $record) |
||
| 31 | { |
||
| 32 | $contextString = ''; |
||
| 33 | |||
| 34 | if ($context = $record->getContext()) { |
||
| 35 | $contextString = strtr( |
||
| 36 | self::CONTEXT_FORMAT, |
||
| 37 | [ |
||
| 38 | '%context%' => $this->dumper->dump($context), |
||
| 39 | ] |
||
| 40 | ); |
||
| 41 | } |
||
| 42 | |||
| 43 | $string = strtr( |
||
| 44 | self::FORMAT, |
||
| 45 | [ |
||
| 46 | '%datetime%' => $record->getDatetime()->format( |
||
| 47 | static::DATETIME_FORMAT |
||
| 48 | ), |
||
| 49 | '%level%' => $record->getLevel(), |
||
| 50 | '%message%' => $record->getMessage(), |
||
| 51 | '%contextPlaceholder%' => $contextString, |
||
| 52 | ] |
||
| 53 | ); |
||
| 54 | |||
| 55 | return $string; |
||
| 56 | } |
||
| 58 |