Skip to content

Commit bdfb962

Browse files
committed
Merge pull request #111 from yeroon/master
Add check to kernel.debug in DebugCompilerPass
2 parents e8f71c9 + ca1851e commit bdfb962

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

DependencyInjection/Compiler/DebugHandlerPass.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Monolog\Logger;
1919

2020
/**
21-
* Adds the DebugHandler when the profiler is enabled.
21+
* Adds the DebugHandler when the profiler is enabled or when kernel.debug is not false.
2222
*
2323
* @author Christophe Coevoet <[email protected]>
2424
* @author Jordi Boggiano <[email protected]>
@@ -38,6 +38,10 @@ public function process(ContainerBuilder $container)
3838
return;
3939
}
4040

41+
if (!$container->getParameter('kernel.debug')) {
42+
return;
43+
}
44+
4145
$debugHandler = new Definition('%monolog.handler.debug.class%', array(Logger::DEBUG, true));
4246
$container->setDefinition('monolog.handler.debug', $debugHandler);
4347

0 commit comments

Comments
 (0)