| 1 | <?php |
||
| 16 | class DbFormatter extends LineFormatter |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @const string |
||
| 20 | */ |
||
| 21 | const FORMAT_DEFAULT = "%message% %context% %extra%"; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @const int |
||
| 25 | */ |
||
| 26 | const MAX_LENGTH_DEFAULT = 65535; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var int |
||
| 30 | */ |
||
| 31 | protected $maxLength; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param string|null $format |
||
| 35 | * @param bool $allowInlineLineBreaks |
||
| 36 | * @param bool $ignoreEmptyContextAndExtra |
||
| 37 | * @param int $maxLength |
||
| 38 | */ |
||
| 39 | 7 | public function __construct( |
|
| 40 | $format = null, |
||
| 41 | $allowInlineLineBreaks = true, |
||
| 42 | $ignoreEmptyContextAndExtra = true, |
||
| 43 | $maxLength = self::MAX_LENGTH_DEFAULT |
||
| 44 | ) { |
||
| 45 | 7 | parent::__construct( |
|
| 46 | 7 | $format ?: static::FORMAT_DEFAULT, |
|
| 47 | 7 | null, |
|
| 48 | $allowInlineLineBreaks, |
||
| 49 | 7 | $ignoreEmptyContextAndExtra |
|
| 50 | ); |
||
| 51 | |||
| 52 | 7 | $this->maxLength = $maxLength; |
|
| 53 | 7 | } |
|
| 54 | |||
| 55 | /** |
||
| 56 | * {@inheritdoc} |
||
| 57 | */ |
||
| 58 | 7 | public function format(array $record) |
|
| 68 | } |
||
| 69 |