[MonologBridge] Allow to change level format
This is needed to allow to remove fixed padding of level name
This commit is contained in:
parent
b0facfec01
commit
fbd257c25d
@ -60,6 +60,7 @@ class ConsoleFormatter implements FormatterInterface
|
|||||||
'date_format' => self::SIMPLE_DATE,
|
'date_format' => self::SIMPLE_DATE,
|
||||||
'colors' => true,
|
'colors' => true,
|
||||||
'multiline' => false,
|
'multiline' => false,
|
||||||
|
'level_name_format' => '%-9s',
|
||||||
), $options);
|
), $options);
|
||||||
|
|
||||||
if (class_exists(VarCloner::class)) {
|
if (class_exists(VarCloner::class)) {
|
||||||
@ -119,7 +120,7 @@ class ConsoleFormatter implements FormatterInterface
|
|||||||
$formatted = strtr($this->options['format'], array(
|
$formatted = strtr($this->options['format'], array(
|
||||||
'%datetime%' => $record['datetime']->format($this->options['date_format']),
|
'%datetime%' => $record['datetime']->format($this->options['date_format']),
|
||||||
'%start_tag%' => sprintf('<%s>', $levelColor),
|
'%start_tag%' => sprintf('<%s>', $levelColor),
|
||||||
'%level_name%' => sprintf('%-9s', $record['level_name']),
|
'%level_name%' => sprintf($this->options['level_name_format'], $record['level_name']),
|
||||||
'%end_tag%' => '</>',
|
'%end_tag%' => '</>',
|
||||||
'%channel%' => $record['channel'],
|
'%channel%' => $record['channel'],
|
||||||
'%message%' => $this->replacePlaceHolder($record)['message'],
|
'%message%' => $this->replacePlaceHolder($record)['message'],
|
||||||
|
Reference in New Issue
Block a user