We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c7d2ef commit f44bb19Copy full SHA for f44bb19
Debug/LoggingMiddleware.php
@@ -21,7 +21,7 @@ class LoggingMiddleware implements MiddlewareInterface
21
{
22
private $logger;
23
24
- public function __construct(LoggerInterface $logger)
+ public function __construct(LoggerInterface $logger = null)
25
26
$this->logger = $logger;
27
}
@@ -31,6 +31,10 @@ public function __construct(LoggerInterface $logger)
31
*/
32
public function handle($message, callable $next)
33
34
+ if (null === $this->logger) {
35
+ return $next($message);
36
+ }
37
+
38
$this->logger->debug('Starting handling message {class}', array(
39
'message' => $message,
40
'class' => get_class($message),
0 commit comments