Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #21705 [Bridge/Monolog] Enhance the Console Handler (lyrixx)
This PR was merged into the 3.3-dev branch. Discussion ---------- [Bridge/Monolog] Enhance the Console Handler | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | - | Fixed tickets | - | License | MIT | Doc PR | - --- I extracted and enhanced the formatting logic from #21080. Basically, The formatter now use the VarDumper & use more significant colors and has a more compact / readable format (IMHO). --- I used the following code to generate before/after screenshots. ```php protected function execute(InputInterface $input, OutputInterface $output) { $logger = $this->getContainer()->get('logger'); $filesystem = $this->getContainer()->get('filesystem'); $anObject = new \stdClass; $anObject->firstPpt = 'foo'; $anObject->secondePpt = 'bar'; $logger->log('notice', 'Hello {who}', [ 'who' => 'Wold', 'an_object' => $anObject, 'file_system' => $filesystem, ]); $r = new \ReflectionClass(LogLevel::class); foreach ($r->getConstants() as $level) { $logger = $logger->withName($level); $logger->log($level, 'log at level {level}', [ 'level' => $level, ]); } } ``` before: ![screenshot12](https://cloud.githubusercontent.com/assets/408368/23183075/0bb21f80-f87b-11e6-8123-f6da70f2493b.png) After: ![screenshot11](https://cloud.githubusercontent.com/assets/408368/23182971/b4022ed8-f87a-11e6-9d3b-de1a9d4ce9aa.png) Commits ------- b663ab5 [Bridge/Monolog] Enhanced the Console Handler
- Loading branch information
Showing
5 changed files
with
195 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters