Skip to content

Commit 153b5f6

Browse files
committed
minor #1841 register a NullLogger to silence logs (xabbuh)
This PR was merged into the 2.3-dev branch. Discussion ---------- register a NullLogger to silence logs Commits ------- d266f3c register a NullLogger to silence logs
2 parents 2775ca4 + d266f3c commit 153b5f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Tests/Functional/app/AppKernel.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
$dir = dirname($dir);
3939
}
4040

41+
use Psr\Log\NullLogger;
4142
use Symfony\Component\Config\Loader\LoaderInterface;
43+
use Symfony\Component\DependencyInjection\ContainerBuilder;
4244
use Symfony\Component\Filesystem\Filesystem;
4345
use Symfony\Component\HttpKernel\Kernel;
4446

@@ -95,6 +97,9 @@ public function getLogDir()
9597
public function registerContainerConfiguration(LoaderInterface $loader)
9698
{
9799
$loader->load($this->rootConfig);
100+
$loader->load(function (ContainerBuilder $container) {
101+
$container->register('logger', NullLogger::class);
102+
});
98103
}
99104

100105
public function serialize()

0 commit comments

Comments
 (0)