From fbd257c25d6529fefefc9900780e1f01251dd0c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Mon, 19 Feb 2018 01:51:42 +0100 Subject: [PATCH] [MonologBridge] Allow to change level format This is needed to allow to remove fixed padding of level name --- src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php b/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php index 83abd5687902c..07c4a7cba40f4 100644 --- a/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php +++ b/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php @@ -60,6 +60,7 @@ public function __construct(array $options = array()) 'date_format' => self::SIMPLE_DATE, 'colors' => true, 'multiline' => false, + 'level_name_format' => '%-9s', ), $options); if (class_exists(VarCloner::class)) { @@ -119,7 +120,7 @@ public function format(array $record) $formatted = strtr($this->options['format'], array( '%datetime%' => $record['datetime']->format($this->options['date_format']), '%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%' => '', '%channel%' => $record['channel'], '%message%' => $this->replacePlaceHolder($record)['message'], pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy