Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfbd257c

Browse files
authored
[MonologBridge] Allow to change level format
This is needed to allow to remove fixed padding of level name
1 parentb0facfe commitfbd257c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function __construct(array $options = array())
6060
'date_format' =>self::SIMPLE_DATE,
6161
'colors' =>true,
6262
'multiline' =>false,
63+
'level_name_format' =>'%-9s',
6364
),$options);
6465

6566
if (class_exists(VarCloner::class)) {
@@ -119,7 +120,7 @@ public function format(array $record)
119120
$formatted =strtr($this->options['format'],array(
120121
'%datetime%' =>$record['datetime']->format($this->options['date_format']),
121122
'%start_tag%' =>sprintf('<%s>',$levelColor),
122-
'%level_name%' =>sprintf('%-9s',$record['level_name']),
123+
'%level_name%' =>sprintf($this->options['level_name_format'],$record['level_name']),
123124
'%end_tag%' =>'</>',
124125
'%channel%' =>$record['channel'],
125126
'%message%' =>$this->replacePlaceHolder($record)['message'],

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp