8000 [MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors by nicolas-grekas · Pull Request #27801 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

[MonologBridge] Add ProcessorInterface, enabling autoconfiguration of monolog processors #27801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Symfony/Bridge/Monolog/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

4.2.0
-----

* added `ProcessorInterface`: an optional interface to allow autoconfiguration of Monolog processors

4.1.0
-----

Expand Down
25 changes: 25 additions & 0 deletions src/Symfony/Bridge/Monolog/Processor/ProcessorInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Bridge\Monolog\Processor;

/**
* An optional interface to allow autoconfiguration of Monolog processors.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
interface ProcessorInterface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny, for twig you forced me to add this interface in twig itself.
Why didn't you do the same thing here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did, see #28845
This has been reverted and added to Monolog meanwhile :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahah. Thanks

{
/**
* @return array The processed records
*/
public function __invoke(array $records);
}
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Monolog/Processor/TokenProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @author Dany Maillard <danymaillard93b@gmail.com>
*/
class TokenProcessor
class TokenProcessor implements ProcessorInterface
{
private $tokenStorage;

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Monolog/Processor/WebProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
class WebProcessor extends BaseWebProcessor implements EventSubscriberInterface
class WebProcessor extends BaseWebProcessor implements EventSubscriberInterface, ProcessorInterface
{
public function __construct(array $extraFields = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Doctrine\Common\Annotations\Reader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Symfony\Bridge\Monolog\Processor\DebugProcessor;
use Symfony\Bridge\Monolog\Processor\ProcessorInterface;
use Symfony\Bridge\Twig\Extension\CsrfExtension;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
Expand Down Expand Up @@ -324,6 +325,8 @@ public function load(array $configs, ContainerBuilder $container)
->addTag('kernel.event_subscriber');
$container->registerForAutoconfiguration(ResettableInterface::class)
->addTag('kernel.reset', array('method' => 'reset'));
$container->registerForAutoconfiguration(ProcessorInterface::class)
->addTag('monolog.processor');
$container->registerForAutoconfiguration(PropertyListExtractorInterface::class)
->addTag('property_info.list_extractor');
$container->registerForAutoconfiguration(PropertyTypeExtractorInterface::class)
Expand Down
0